Accessing a cell in a different worksheet with a macro

etpeterson

New Member
Joined
Jan 19, 2005
Messages
18
I h ave a workbook with 16 worksheets. In worksheets 2-16 I need to get a value in worksheet 1 and then paste it into each worksheet. This needs to be done within a large subroutine so I don't want to do this iterativley. Currently, my macro selects WS1, gets the value and then selects WS2 and pastes the value. I would like my subroutine to get the value without having to actually select the worksheet. That way as I create the individual worksheets, I can say, "get data from cell B10 in WS1 and past it in the current worksheet." Then when the next worksheet is created, I can execute the same code.

Please Help!

Thanks,
Eric
 

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.
Hi there

Try something like this

Code:
ActiveSheet.Range("a1").Value = Worksheets("Sheet1").Range("b2").Value

This will copy the value from B2 on Sheet1, to cell A1 on the active sheet.

Hope it helps

Richard
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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