View Single Post
 
Old 10-12-2014, 03:50 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
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