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: 111
Default Extract Data Code Modification Request

To all,

I have the code shown below. It basically extracts data from one
workbook and dumps it into another workbook. It extracts the data
based on the 'res' condition. At the moment it searchs for one value
for 'res'. 'res' is a date. How do I modify the code to serach and
extract all the data based on a range of dates. For example res1 =
date1, and res2 = date2?

Thanks for your help on advance,

Regards,

Joseph Crabtreee

__________________________________________________ _


Set wbd = ThisWorkbook
Set wsd = wbd.Worksheets("DATA")
Set wbs = Workbooks.Open("\\s-ddideagen\dd-departments\Metallurgy\Kevin
\compile mech test results\all mechanical test results", , True) '<--
FILE NAME OF MECHANICAL TESTING FILE
Set wss = wbs.Worksheets("compiled results") ' <--- WORKSHEET WITH
DATA


row_d = 2 ' - defines starting row number


'Looks in column c, part number to find all cells CONTAINING value
res, returned above.

With Worksheets("compiled results").Range("C2:C65000")

Set c = .Find(res, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.EntireRow.Copy wbd.Worksheets("DATA").Rows(row_d) ' data
is copied line by line into the current workbook

row_d = row_d + 1

Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With




wbs.Close False
Set wss = Nothing
Set wbs = Nothing
Set wsd = Nothing
Set wbd = Nothing
 
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
Extract Date, and summarize data request joecrabtree Excel Programming 1 December 19th 08 12:35 PM
code to extract data from a website runs of XP but not Vista Russ Excel Programming 1 May 16th 08 01:30 AM
vba code for excel to extract data from txt file JE New Users to Excel 3 June 11th 07 09:19 PM
Code modification help please Tom Excel Programming 2 April 10th 07 06:44 PM
Modification in the CODE to HIDE rows and columns that start with ZERO (code given) Thulasiram[_2_] Excel Programming 4 September 26th 06 04:15 AM


All times are GMT +1. The time now is 09:39 PM.

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"