LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default trim data and search for text strings

I have id tags that when scanned turn up in excel in the following format

982 000140555698 or 982 000140555612


The actual id number is always numbers no letters has 16 spaces in the format
000 000000000000. Nearly always it turns up with the sign in front but not
always.

I use the following code to get rid of any excess text

ID = Mid(Target, WorksheetFunction.Search(" ", Target) - 3, 16)

The target is dim as range

I then have to use the id number to search through 2 columns of id numbers
and find the associated rider team number. Column headings are like this

Team number Rider1 Tag id Rider2 tag id

100 982 000140555698 982 000140555612
101 982 000140555816 982 000140555836
etc

To find the address of the cell where the scanned id tag is I use

Set RiderCell = Sheet22.Range("b4:c804").Find(Target, , xlValues)

then to find the team number

Team = Sheet22.Cells(RiderCell.Row, 1)

This works well for the few scanned id tags that don't have the in front
of the number but any id's that come in like 982 000140555698 then it
doesn't work for some reason. I have checked the mid statement and it seems
to be doing the job.

Is there a way I can set this up so that it will work for both possible
scanned inputs.

Thanks




 
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
How do I filter or search mulitple for text strings? MikeD Excel Discussion (Misc queries) 2 October 29th 08 01:07 PM
Search multiple strings in one text file flaterp Excel Programming 4 February 4th 08 07:06 PM
Fast way to search many cells by column for text strings Mikee Excel Discussion (Misc queries) 2 July 1st 05 06:44 PM
Search through individual data strings bcmiller Excel Programming 1 May 19th 04 05:01 PM
Search and Replace text strings within Macros Chris Austin Excel Programming 1 September 5th 03 04:39 PM


All times are GMT +1. The time now is 08:45 AM.

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

About Us

"It's about Microsoft Excel"