Nicolaf
12-11-2012, 02:46 AM
Hi,
I have the following code for opening files:
Sub Open_file()
Iname = Range("B2").Value 'name with extension
Workbooks.Open Filename:="P:\General\Files\" & Iname
Sheets("Sheet2").select
End Sub
I would now like to change the code so the part that refers to Sheet2 is actually a Cell reference eg. cell B4
This way the file will open the sheet name that I put in Cell B4 (eg. Sheet3 or Sheet4 etc.) rather than having something hardcoded in code.
How do I do this?
:dunno :dunno
Nix
I have the following code for opening files:
Sub Open_file()
Iname = Range("B2").Value 'name with extension
Workbooks.Open Filename:="P:\General\Files\" & Iname
Sheets("Sheet2").select
End Sub
I would now like to change the code so the part that refers to Sheet2 is actually a Cell reference eg. cell B4
This way the file will open the sheet name that I put in Cell B4 (eg. Sheet3 or Sheet4 etc.) rather than having something hardcoded in code.
How do I do this?
:dunno :dunno
Nix