Vba button to open another workbook from the same folder

aerobharath15

New Member
Joined
Mar 14, 2018
Messages
11
hi,

I have a folder template called "QUOTE 1" inside which i have 1.xlsm and 2.xlsx excel files. I'm setting up a macro 'button' in 1.xlsm to open 2.xlsx from the same folder.

Please can you provide a vba code to achieve this?

Please note that I will duplicate folder template and rename. So the macro should always open 2.xlsx from the same folder as 1.xlsm irrespective of the folder name.

thanks in advance.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try this.

Code:
Workbooks.Open(ThisWorkbook.Path & "\2.xlsx")
 
Upvote 0

Forum statistics

Threads
1,225,383
Messages
6,184,642
Members
453,250
Latest member
unluckyuser

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