Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2014, 03:50 AM
tinfanide tinfanide is offline How to Pass Arguments in a Formula? Windows 7 64bit How to Pass Arguments in a Formula? Office 2010 32bit
Expert
How to Pass Arguments in a Formula?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default How to Pass Arguments in a Formula?

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False

Dim oSchoolWorkTable As ListObject, sSchoolWorkTable As String
Set oSchoolWorkTable = ListObjects("SchoolWorkTable")
sSchoolWorkTable = oSchoolWorkTable.Name & "[#This Row]"

With oSchoolWorkTable.ListColumns("Name").Range.FormatConditions _
'''
    .Add(xlExpression, Formula1:="=COUNTIF(INDIRECT("" & sSchoolWorkTable & ""),FALSE)>0")
'''
    .Interior.Color = RGB(255, 199, 206)
    .Font.Color = RGB(156, 0, 6)
End With

Application.EnableEvents = True
End Sub
I wonder how I could pass the argument in the INDIRECT function.


Thank you.
Reply With Quote
  #2  
Old 10-13-2014, 06:09 AM
tinfanide tinfanide is offline How to Pass Arguments in a Formula? Windows 7 64bit How to Pass Arguments in a Formula? Office 2010 32bit
Expert
How to Pass Arguments in a Formula?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

I've resolved it myself.
Reply With Quote
  #3  
Old 10-13-2014, 06:10 AM
tinfanide tinfanide is offline How to Pass Arguments in a Formula? Windows 7 64bit How to Pass Arguments in a Formula? Office 2010 32bit
Expert
How to Pass Arguments in a Formula?
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

I've resolved it myself.

Code:
Dim sIndirect As String

sIndirect = "INDIRECT(""" & oSchoolWorkTable.Name & "[#This Row]"")"

With oSchoolWorkTable.ListColumns("Name").Range.FormatConditions _
    .Add(xlExpression, Formula1:="=COUNTIF(" & sIndirect & ",FALSE)>0")
End With
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Pass Arguments in a Formula? Get and pass name of clicked ActiveX check box NobodysPerfect Excel Programming 17 06-04-2014 06:20 AM
How to Pass Arguments in a Formula? How to Pass Document to this Sub ilcaa72 Word VBA 1 01-28-2014 03:04 PM
How to Pass Arguments in a Formula? Can pass .expression as a parameter? tinfanide PowerPoint 4 12-28-2012 06:14 PM
How to pass parameters to a .msg file? HereNow Outlook 0 11-05-2012 10:38 AM
Office 2010 Excel Full pass raineraus Excel 1 09-19-2012 12:55 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft