With block does not work on inactive worksheet?
Hi All,
I have these lines inside a function -
Dim ws As Worksheet
Set ws = Sheets(SheetName)
ws.Activate
colCount = ws.UsedRange.Columns.count
With ws.Range(Cells(1, 1), Cells(1, colCount))
Set c = .Find("C", LookIn:=xlValues, LookAt:=xlWhole,
MatchCase:=True)
'.......
End With
Until ws.Activate was added, it jumped out of a function on With statement.
Weird....
|