Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / May 2006

Tip: Looking for answers? Try searching our database.

Macro or function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MIchel Khennafi - 15 May 2006 20:54 GMT
Good afternoon,

I have a situation where the content of a cell is based on what the active
cell is. This is to display a Help message. I know i could use the Data >
Validation > Message but this is not a good use for what we are trying to
achieve.

If the Active cell is A1, then B1 = the content of a cell C1
If the Active cell is A2, then B1 = the content of a cell C2
If the Active cell is A3, then B1 = the content of a cell C3
... and so on

Has anyone created such a macro (i suppose this is a worksheet macro)... Any
help woul dbe welcome
Miguel Zapico - 15 May 2006 21:14 GMT
You may try this macro in the SelectionChange event of the worksheet:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
   On Error Resume Next
   If Target.Column = 1 Then
       Range("B1").Value = Target.Offset(0, 2).Value
   End If
End Sub

Hope this helps,
Miguel.

> Good afternoon,
>
[quoted text clipped - 10 lines]
> Has anyone created such a macro (i suppose this is a worksheet macro)... Any
> help woul dbe welcome
Gary''s Student - 15 May 2006 21:16 GMT
In worksheet code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
Range("B1").Value = Range("C1").Value
End If
If Not Intersect(Target, Range("A2")) Is Nothing Then
Range("B1").Value = Range("C2").Value
End If
If Not Intersect(Target, Range("A3")) Is Nothing Then
Range("B1").Value = Range("C3").Value
End If
End Sub

This will trigger from either a mouse click or arrow key usage.

REMEMBER:  worksheet code
Signature

Gary's Student

> Good afternoon,
>
[quoted text clipped - 10 lines]
> Has anyone created such a macro (i suppose this is a worksheet macro)... Any
> help woul dbe welcome
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.