View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Daminc[_67_] Daminc[_67_] is offline
external usenet poster
 
Posts: 1
Default Assign a macro to a hyperlink


I found this whilst trawling the web and I was wondering if there wa
some way to modify the macro (specifically the 'Select Cas
Target.Address'
'Case “$A$1″' area) to run through many rows without having t
create a seperate Case per row (i.e. having 'i' as the number of row
and creating 'Case “$A$i″).

I would be grateful for any thoughts on this matter :)

Cheers.

-"Independent of the hyperlink, put a SelectionChange event in th
worksheet code module. To do this, right click the sheet tab, an
select View Code. In the code module that pops up, select Workshee
from the top left dropdown, which puts the following procedure into th
code module:"-



Code
-------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
You then adjust what’s between the Sub and End Sub to get what you want:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Address
Case “$A$1″
‘ carry out action for Cell A1
Case “$A$2″
‘ carry out action for Cell A2
‘ etc.
End Select
End Sub
-------------------

--
Damin
-----------------------------------------------------------------------
Daminc's Profile: http://www.excelforum.com/member.php...fo&userid=2707
View this thread: http://www.excelforum.com/showthread.php?threadid=53720