It's been a long time...

Mr Nick

Board Regular
Joined
Mar 11, 2002
Messages
95
It's been a long time since I worked with Excel and alot of my knowledge has been pushed aside with other more recent stuff. I have now just started looking at some old Excel stuff and have realised that one of the basics I have forgotten is how to reference a workbook in relative terms.

I want to open a sheet and when it opens, it opens a further sheet automatically ie Workbooks.Open FileName:="C:\Branches.xls" but without specifying where the file is stored as it will always be in the same directory as the first sheet opened but could be on any drive in any subdirectory.

A quick nudge in the right direction would be much appreciated.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Mr Nick said:
It's been a long time since I worked with Excel and alot of my knowledge has been pushed aside with other more recent stuff. I have now just started looking at some old Excel stuff and have realised that one of the basics I have forgotten is how to reference a workbook in relative terms.

I want to open a sheet and when it opens, it opens a further sheet automatically ie Workbooks.Open FileName:="C:\Branches.xls" but without specifying where the file is stored as it will always be in the same directory as the first sheet opened but could be on any drive in any subdirectory.

A quick nudge in the right direction would be much appreciated.

Do you need this ?

Code:
Workbooks.Open ThisWorkbook.Path & "\Branches.xls"
Sheets(1).Select
 
Upvote 0

Forum statistics

Threads
1,221,691
Messages
6,161,322
Members
451,696
Latest member
Senthil Murugan

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