Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trim Find Issue
Dim HeadingsToSync As Variant
Dim rngFound As Range HeadingsToSync = Array("AA",BB", CC", DD % of Total, "XX AA/BB) For y = LBound(HeadingsToSync) To UBound(HeadingsToSync) Set rngFound = Cells.Find(What:=HeadingsToSync(y), _ After:=ActiveCell, _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True, _ SearchFormat:=False) ================================== Though the parameters in HeadingsToSyncs array are keyed in correctly, their counterparts in any given sheet may have trailing or leading spaces. Where exactly should I place the trim for cell being searched? Will keep trying but keep getting a runtime error type mismatch 13. Appreciatively, Arturo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trim Find Issue
Instead of looking at xlwhole, maybe looking at xlpart would be sufficient.
Arturo wrote: Dim HeadingsToSync As Variant Dim rngFound As Range HeadingsToSync = Array("AA",BB", CC", DD % of Total, "XX AA/BB) For y = LBound(HeadingsToSync) To UBound(HeadingsToSync) Set rngFound = Cells.Find(What:=HeadingsToSync(y), _ After:=ActiveCell, _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True, _ SearchFormat:=False) ================================== Though the parameters in HeadingsToSyncs array are keyed in correctly, their counterparts in any given sheet may have trailing or leading spaces. Where exactly should I place the trim for cell being searched? Will keep trying but keep getting a runtime error type mismatch 13. Appreciatively, Arturo -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is this a trim issue | New Users to Excel | |||
Issue with Find | Excel Discussion (Misc queries) | |||
Find Issue (Menu Find) | Excel Discussion (Misc queries) | |||
VBA Trim and Application.worksheetfunction.Trim | Excel Programming | |||
Trim: Excel 97 gives error "Can't find project or library" | Excel Programming |