Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is this a trim issue Box666 New Users to Excel 4 March 22nd 10 02:07 AM
Issue with Find Farooq Sheri Excel Discussion (Misc queries) 5 October 13th 09 09:52 AM
Find Issue (Menu Find) PatK Excel Discussion (Misc queries) 4 December 3rd 07 04:51 PM
VBA Trim and Application.worksheetfunction.Trim Hari Prasadh Excel Programming 3 January 19th 05 02:22 PM
Trim: Excel 97 gives error "Can't find project or library" Jim Mooney Excel Programming 10 August 30th 04 08:22 PM


All times are GMT +1. The time now is 05:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"