Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default hyperlink macro

is there a way to have it when i click on cell A1 it will have a message box
of value in b1. if i click on a2, message box of b2...etc

thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default hyperlink macro

Hi Choice,

Try:

'=============
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rng As Range

Set rng = Me.Range("A1:A10") '<<==== CHANGE

If Not Intersect(rng, Target) Is Nothing Then
With Target
MsgBox "The value of " & .Address(0, 0) _
& " = " & Target.Offset(0, 1).Value
End With
End If

End Sub
'<<=============

This is worksheet event code and should be pasted into the worksheets's code
module (not a standard module and not the workbook's ThisWorkbook module):

Right-click the worksheet's tab
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.


---
Regards,
Norman



"choice" wrote in message
...
is there a way to have it when i click on cell A1 it will have a message
box
of value in b1. if i click on a2, message box of b2...etc

thanks in advance



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro in Hyperlink adeel via OfficeKB.com Excel Discussion (Misc queries) 1 July 3rd 09 08:31 PM
run macro hyperlink SueQueen Excel Discussion (Misc queries) 2 September 15th 08 05:23 AM
Can I get a hyperlink to run a macro? Scott buckwalter Excel Programming 1 August 11th 05 04:08 PM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM
Macro to Copy Hyperlink to another file as a HYPERLINK, not text... dollardoc Excel Programming 1 April 7th 05 12:47 AM


All times are GMT +1. The time now is 06:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"