Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MIchel Khennafi
 
Posts: n/a
Default Macro or function

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



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Miguel Zapico
 
Posts: n/a
Default Macro or function

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.

"MIchel Khennafi" wrote:

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




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default Macro or function

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
--
Gary's Student


"MIchel Khennafi" wrote:

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




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
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
If than copy function / Macro Sweetetc Excel Worksheet Functions 2 April 7th 06 06:30 PM
Using "mailto" function in a macro Mike Excel Discussion (Misc queries) 0 March 24th 06 02:51 AM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Function Macro for Nested IF Qaspec Excel Worksheet Functions 5 March 10th 05 07:25 PM


All times are GMT +1. The time now is 01:30 AM.

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"