Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
try:
Dim iRow As Integer Dim myCriteria As String iRow = 2 For Each c In Worksheets("WatchCriteria").Range("A2:A19") If c.Value < "" Then myCriteria = "=" & c.Value Worksheets("WatchList").Range("B" & iRow).Formula = myCriteria iRow = iRow + 1 End If Next c "JEFFWI" wrote: I am building a criteria string for an Advanced Filter feature. The string values exist in a spreadsheet. I need to prepend ="= and append a trailing quote. When I do the varialbe myCriteria does not resolve. Here is the code snippet: Dim iRow As Intege Dim myCriteria As String iRow = 2 For Each c In Worksheets("WatchCriteria").Range("A2:A19") If c.Value < "" Then myCriteria = c.Value Worksheets("WatchList").Range(Cells(iRow, 2), Cells(iRow, 2)).Formula = "=""=myCriteria""" iRow = iRow + 1 End If Next c I want the actual value of the myCriteria variable to resolve within the cell. Instead I get ="=myCriteria" Can anyone suggest a way to do this? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Advanced filter criteria | Excel Discussion (Misc queries) | |||
Advanced Filter (Criteria + Blanks) | Excel Discussion (Misc queries) | |||
Need Advanced Filter with NOT equal string and OR criteria | Excel Discussion (Misc queries) | |||
Advanced filter and Criteria Range | Excel Discussion (Misc queries) | |||
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du | Excel Worksheet Functions |