Trim Find Issue

G

Guest

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 HeadingsToSync’s 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
 
D

Dave Peterson

Instead of looking at xlwhole, maybe looking at xlpart would be sufficient.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top