Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Data Extract and Sort Macro Help

To all,

Part of my macro is showed below, it opens up a file and then searches
column A, and copies the row if it matches a certain criteria, i.e. if
the cell = FR 2096799. However sometimes the cell is FR2096799 -
without the space, or just 2096799. How can i modify it to search for
all cells in column A that 'CONTAIN' the number 2096799, not EQUAL
2096799.

Any help would be appreciated.

Kind Regards

Joseph Crabtree




Dim wbd As Workbook
Dim wsd As Worksheet
Dim wbs As Workbook
Dim wss As Worksheet


Dim row_d As Long
Dim row_s As Long


Set wbd = ThisWorkbook
Set wsd = wbd.Worksheets("DATA")


Set wbs = Workbooks.Open("C:\TESTMECH.xls", , True)
Set wss = wbs.Worksheets("compiled results")


row_d = 2
row_s = 1


Do
If UCase(wss.Cells(row_s, 3)) = "FR 2096799" Then
wss.Rows(row_s).Copy wsd.Rows(row_d)
row_d = row_d + 1
End If
row_s = row_s + 1
Loop While row_s < 65536




wbs.Close False
Set wss = Nothing
Set wbs = Nothing
Set wsd = Nothing
Set wbd = Nothing

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
Data Extract and sort joecrabtree Excel Programming 0 November 20th 06 03:56 PM
Please help me sort then extract the data to new workbooks tahrah Excel Programming 5 November 12th 06 10:29 PM
MACRO TO EXTRACT DATA jay dean Excel Programming 0 October 8th 06 09:25 AM
extract data after sort Sody Excel Programming 0 July 17th 06 11:32 PM
Macro to extract data Bill A Excel Discussion (Misc queries) 3 February 15th 06 12:30 PM


All times are GMT +1. The time now is 05:45 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"