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.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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.
 
Upvote 0
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?
 
Upvote 0
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:\.
 
Upvote 0
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.
 
Upvote 0
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:
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,476
Members
448,967
Latest member
visheshkotha

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