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

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

R_Stephens

Board Regular
Joined
Dec 23, 2004
Messages
143
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
 

Forum statistics

Threads
1,148,273
Messages
5,745,794
Members
423,973
Latest member
man_this_is_hard

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
Top