ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help with macro (https://www.excelbanter.com/excel-discussion-misc-queries/53256-help-macro.html)

Ken G.

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.

Biff

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.




Ken G.

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.





chelles

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.


Dave Peterson

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


All times are GMT +1. The time now is 10:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com