Red
Red

Reputation: 1

VBA Personal Macro to Activate a cell with a hyperlink in it

I need to write a Macro in VBA that when the user clicks on the assigned macro, it will activate the hyperlink in the given cell. The macro is going to be attached to a picture rather then seeing the text of the hyperlink. I have this code right now and it does work, however, when the macro activates the hyperlink, it minimizes the folder it opened, when it should open it on top of excel like when a user would click directly on a hyperlink.

 Sub FollowHyperlink()
 '
 ' FollowHyperlink Macro
 '
 Shell "explorer.exe " & Range("T6").Text
 '
 End Sub 

Upvotes: 0

Views: 504

Answers (1)

Adi2412
Adi2412

Reputation: 11

Sub FollowHyperlink()
 '
 ' FollowHyperlink Macro
 '
 a = Shell("C:\Program Files\Internet Explorer\iexplore.exe " & Range("T6").Text, vbMaximizedFocus)
 '
 End Sub

Upvotes: 1

Related Questions