Go to Worksheet based on a cell

bobaol

Board Regular
Joined
Jun 3, 2002
Messages
225
Office Version
  1. 365
  2. 2003 or older
Platform
  1. Windows
Hello, I have many files with different sheet names. Each file has the original sheet, and a duplicate of that sheet. For example, I have sheets Modern, and Modern (2) All the dirty work is done in the sheet Modern (2), then after it is all done and pretty, it is copied to the sheet Modern. The only commonality is the naming of the sheets with (2), for example, Manny and Manny (2) or Sunny and Sunny (2).

Here is the problem, in cells A5 of Modern (2), I used the =("filename") formula to define the other sheet, Modern. So, in the sheet Modern (2), cell A5, the value is Modern . I want my macro to say something like this:
Application.Goto Reference:="R1C1"
Selection.Copy
' Sheets("Modern").Select
Sheets.Range("A5").Text.Select
Application.Goto Reference:="R2C1"
Selection.PasteSpecial Paste:=xlPasteValues

The macro above does not work. I want to select the sheet based on cell A5 because there are many different sheets with different names.

Any help is appreciated.

Thanks in advance
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try:
Code:
Sheets(Range("A5").Text).Select

Alternatively replace above with:
Code:
Sheets(Cells(5, 1).Text).Cells(2,1).Value = Cells(1,1).Value
Range("A5") is same object cell as Cells(5, 1) - i.e. row 5 of column 1 (A being first column)
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,206
Members
453,022
Latest member
RobertV1609

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