call a sheet by cell info

Lball

Board Regular
Joined
Oct 4, 2005
Messages
197
HI,
If I have Sheets named for any data in Col "D", how do i write code to copy selected data to that named sheet?

Range(Cells(j, "A"), Cells(i - 1, "H")).Copy
Sheets???.select ("THIS IS WHERE I WANT TO CALL WORKSHEET NAMED FOR CELLS (i,"D")
Cells(14, "A").Select
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I'm not entirely following you but I am assuming that the variable 'i' is a row number. So you could declare a variable to pick up the relevant cell reference. As an example:

Code:
SheetName = Cells(i, 4).Value
Sheets(SheetName).Activate

However if you're copying the data into A14 why not try:

Code:
SheetName = Cells(i, 4).Value
'Your Range'.Copy Destination:=Sheets(SheetName).Cells(14, 1)
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,220
Members
452,895
Latest member
BILLING GUY

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