Macro to copy and past data

UMAKEMESIK

Active Member
Joined
Oct 3, 2005
Messages
378
I have a work book with two sheets.

Sheet 1 is a look up query sheet.

sheet 2 has all the data


I would like to put a value into cell a1 of sheet 1 - for examples "Box1"

the macro would look in sheet 2 for a value of "box 1" in column A of sheet 2

the macro would then copy the data from sheet 2 in column B that corresponds to the Value of "Box 1"

The value from column b of sheet 2 would then be pasted into sheet 1 "B1"

so the result would look like on sheet 1:

an input value on sheet 1 in A1 with the corresponding info on sheet 1 b1

thanks in advance
 
Do you need a macro? It sounds like a vlookup might be a better solution.


Works great - thanks for the help.

Do you think it's possible to do this as well?

I would like to search for a size and return all values with a +1 or -1 range.

for example:

My input values would be length width and depth.

ie. 12 x 12 x 12 ( most likely in three different cells)
This is the data I enter, or can be pharsed in one cell if that is easier and can work ie. 12x12x12


now the return results would go to row 1 to......... and column c, d and e.

Cell b would return the box name - i.e - Box1
if there are multiple hits the rusults would go down column b

B0x 5
box 8

etc.........

all would fall with in the +/- 1 range of the original input value.

Cells c, d and e would return the box sizes.

ie....

11 x 11 x 11
12 x 11 x 13
13 x 11 x 12

all of these results fall within the =/- range.

Seems complex and may need VB for this but if this can be done with v lookup or index or match that would be great.

any thoughts.
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Happy to help.

That sounds much more involved. I don't have a solution off the top of my head. I would suggest making that question a new thread, since it's technically a different scenario. I can research it a bit and try a few things. Someone more adept with VB might be able to solve it right away.
 
Upvote 0

Forum statistics

Threads
1,215,436
Messages
6,124,869
Members
449,192
Latest member
MoonDancer

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top