Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() If Range("h9").Value = "N" Then Selection.AutoFilter Field:=1, Criteria1:="+" End If I want to be able to replace "h9" with a variable that i can change frequently. (ie h9, j12,or whatever cell address i want to use). I have tried .... Dim Ant string Ant = "h9" If Range("Ant").Value = "N" Then Selection.AutoFilter Field:=1, Criteria1:="+" End If This however does not work. I am not sure of the proper syntax to achieve this goal. Thanks in advance-- dr chuck |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
take the quotes away from ANT - with quotes, you are referring to a
named range ANT, without you are referring to the variable - so if range(ant).value etc |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim Ant as String
Ant="H9" if range(Ant).value="N" then HTH -- AP "dr chuck" a écrit dans le message de news: ... If Range("h9").Value = "N" Then Selection.AutoFilter Field:=1, Criteria1:="+" End If I want to be able to replace "h9" with a variable that i can change frequently. (ie h9, j12,or whatever cell address i want to use). I have tried .... Dim Ant string Ant = "h9" If Range("Ant").Value = "N" Then Selection.AutoFilter Field:=1, Criteria1:="+" End If This however does not work. I am not sure of the proper syntax to achieve this goal. Thanks in advance-- dr chuck |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Remove the ""
Dim Ant string Ant = "h9" If Range(Ant).Value = "N" Then Selection.AutoFilter Field:=1, Criteria1:="+" End If -- Message posted via http://www.officekb.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks guys .. for the immediate help
-- dr chuck "Crowbar via OfficeKB.com" wrote: Remove the "" Dim Ant string Ant = "h9" If Range(Ant).Value = "N" Then Selection.AutoFilter Field:=1, Criteria1:="+" End If -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to create a range address with ADDRESS function? | Excel Worksheet Functions | |||
select range and put range address in variable | Excel Programming | |||
Range Address Memory Variable Limitation | Excel Programming | |||
How do you get a Selected Range address into a variable? | Excel Programming |