Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here' my code:
Dim varSht As Variant Dim FoundCell As Range ' Iterates through sheets, finds data, & replaces data For Each varSht In Workbooks(sFilename).Sheets ' Use Excel's Internal Find & Replace Method Set FoundCell = varSht.Cells.Replace(What:=sFindWhat, _ Replacement:=sReplaceWith, _ LookAt:=vLookAt, MatchCase:=bMatchCase) If Not FoundCell Is Nothing Then fncStdFind = True Exit Function End If Next When I run this, the 'Set FoundCell = varSht.Cells.Replace' line is highlighted, and the error 'Object required.' is displayed. If I change 'Dim varSht As Variant' to 'Dim varSht As WorkSheet', then it gives me a 'Type mismatch' error with the same line highlighted. What the heck? -- Trent Argante [DC.J(455)] |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Object Required | Excel Programming | |||
Object Required | Excel Programming | |||
Object Required | Excel Programming | |||
Object Required | Excel Discussion (Misc queries) | |||
Object required? | Excel Programming |