#1   Report Post  
Ken G.
 
Posts: n/a
Default Help with macro

I have a workbook with 2 worksheets. Each contains a column of part numbers
with associated data. What I want to do is look at a part number in the
second sheet and bring over some of the data for that part number from the
first sheet.
I know I can't use Vlookup across 2 sheets, and in any case I don't want to
re-sort the data as required by vlookup. (its in date order, not part number
order) I'm guessing this can only be done with a macro.
Can anyone help?

Thanks.
  #2   Report Post  
Biff
 
Posts: n/a
Default Help with macro

Hi!

I know I can't use Vlookup across 2 sheets, and in any case I don't want to
re-sort the data as required by vlookup. (its in date order, not part
number
order)


You can use Vlookup across sheets and the data only needs to be sorted if
you're dealing with numeric values where there may not be an exact match.

Can you post a small sample of data?

Biff

"Ken G." wrote in message
...
I have a workbook with 2 worksheets. Each contains a column of part numbers
with associated data. What I want to do is look at a part number in the
second sheet and bring over some of the data for that part number from the
first sheet.
I know I can't use Vlookup across 2 sheets, and in any case I don't want
to
re-sort the data as required by vlookup. (its in date order, not part
number
order) I'm guessing this can only be done with a macro.
Can anyone help?

Thanks.



  #3   Report Post  
Ken G.
 
Posts: n/a
Default Help with macro

Thanks Biff. Don't know where I got the idea vlookup wouldn't work across two
sheets. All done now.

"Biff" wrote:

Hi!

I know I can't use Vlookup across 2 sheets, and in any case I don't want to
re-sort the data as required by vlookup. (its in date order, not part
number
order)


You can use Vlookup across sheets and the data only needs to be sorted if
you're dealing with numeric values where there may not be an exact match.

Can you post a small sample of data?

Biff

"Ken G." wrote in message
...
I have a workbook with 2 worksheets. Each contains a column of part numbers
with associated data. What I want to do is look at a part number in the
second sheet and bring over some of the data for that part number from the
first sheet.
I know I can't use Vlookup across 2 sheets, and in any case I don't want
to
re-sort the data as required by vlookup. (its in date order, not part
number
order) I'm guessing this can only be done with a macro.
Can anyone help?

Thanks.




  #4   Report Post  
Posted to microsoft.public.excel.misc
chelles
 
Posts: n/a
Default Help with macro

How do you make the vlookup continue on down a column, basically repeating
the same function?


"Ken G." wrote:

I have a workbook with 2 worksheets. Each contains a column of part numbers
with associated data. What I want to do is look at a part number in the
second sheet and bring over some of the data for that part number from the
first sheet.
I know I can't use Vlookup across 2 sheets, and in any case I don't want to
re-sort the data as required by vlookup. (its in date order, not part number
order) I'm guessing this can only be done with a macro.
Can anyone help?

Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Help with macro

Dim myRng as range
dim myCell as range

with activesheet
set myrng = .range("A1",.cells(.rows.count,"A").end(xlup))
end with

for each mycell in myrng.cells
'do something to mycell
next mycell

is one way.

chelles wrote:

How do you make the vlookup continue on down a column, basically repeating
the same function?

"Ken G." wrote:

I have a workbook with 2 worksheets. Each contains a column of part numbers
with associated data. What I want to do is look at a part number in the
second sheet and bring over some of the data for that part number from the
first sheet.
I know I can't use Vlookup across 2 sheets, and in any case I don't want to
re-sort the data as required by vlookup. (its in date order, not part number
order) I'm guessing this can only be done with a macro.
Can anyone help?

Thanks.


--

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
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 07:45 PM.

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"