Macro question?

gawd89108

New Member
Joined
Jun 27, 2008
Messages
21
I am new at Excel and of course macro's. I have placed a button on my worksheet in which I want it to direct the user to my G:/ drive when clicked. I am not good at writing macro's yet and it's giving me a head ache.... :eek: Thanks in advance.
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Blade Hunter

Well-known Member
Joined
Mar 13, 2008
Messages
3,147
You don't need a button you can use a hyperlink.

Put the text in a cell then highlight that cell and press CTRL-K

Browse to your G drive in the box that comes up and click OK.

Clicking the text in that cell will open the G drive.
 

gawd89108

New Member
Joined
Jun 27, 2008
Messages
21
Thanks, but I would like to use the button feature as I have several other buttons on the sheet doing different things. Is it possible to have a macro hyperlink to my drive?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,218
Office Version
  1. 365
Platform
  1. Windows
Try this.
Rich (BB code):
Option Explicit
 
Sub Button1_Click()
    ThisWorkbook.FollowHyperlink "file:\\G:\"
End Sub
Note if G:\ is a mapped drive you might need to use the UNC path rather than just G:\.
 

gawd89108

New Member
Joined
Jun 27, 2008
Messages
21
Try this.
Rich (BB code):
Option Explicit
 
Sub Button1_Click()
    ThisWorkbook.FollowHyperlink "file:\\G:\"
End Sub
Note if G:\ is a mapped drive you might need to use the UNC path rather than just G:\.

How do I go about using the UNC path because the other code did not work. Thanks for the help by the way.
 

gawd89108

New Member
Joined
Jun 27, 2008
Messages
21
Figured it out!!!! Thanks a million homie.....
If your ever in VEGAS hit me up and I'll show you the time of your life :ROFLMAO:
 

Watch MrExcel Video

Forum statistics

Threads
1,122,519
Messages
5,596,634
Members
414,082
Latest member
sasmita

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
Top