Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selected Cell equals x then..

Fairly certain that if this is possible it would be done in VBA, howeve
very uncertain of how to approach this.

Here is what I am trying to accomplish.

I would like the worksheet to recognize what cell the user currentl
has selected and then change the data in another cell based upon th
selection.

IE. If the user has cell B3 selected then I would like cell C4 to b
populated with the message "You have B3 selected." If the user has cel
A1 selected, then the same cell C4 would be populated with the messag
"You have A1 selected."

Any help would be greatly appreciated.

~RBHick

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Selected Cell equals x then..

Hi
can be done with a worksheet event (selection_change). Put the
following code in your worksheet module (not in a standard module):
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Me.Range("C4").Value = "You have selected" & Target.Address
Application.EnableEvents = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany


Fairly certain that if this is possible it would be done in VBA,
however very uncertain of how to approach this.

Here is what I am trying to accomplish.

I would like the worksheet to recognize what cell the user currently
has selected and then change the data in another cell based upon the
selection.

IE. If the user has cell B3 selected then I would like cell C4 to be
populated with the message "You have B3 selected." If the user has
cell A1 selected, then the same cell C4 would be populated with the
message "You have A1 selected."

Any help would be greatly appreciated.

~RBHicks


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Selected Cell equals x then..

Open VB editor. In the project window(far left) select the
sheet you wish the message to appear. In left combo box
above the code window, click the down arrow and select
worksheet. in the right combo box above the code window,
select SelectionChange. In the code window enter this code:
Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
'MsgBox ("you have selected" & " " & ActiveCell.Address)
'or
Range("C4").FormulaR1C1 = "You have selected" & " " &
ActiveCell.Address
End Sub

-----Original Message-----
Fairly certain that if this is possible it would be done

in VBA, however
very uncertain of how to approach this.

Here is what I am trying to accomplish.

I would like the worksheet to recognize what cell the

user currently
has selected and then change the data in another cell

based upon the
selection.

IE. If the user has cell B3 selected then I would like

cell C4 to be
populated with the message "You have B3 selected." If the

user has cell
A1 selected, then the same cell C4 would be populated

with the message
"You have A1 selected."

Any help would be greatly appreciated.

~RBHicks


---
Message posted from http://www.ExcelForum.com/

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selected Cell equals x then..

Thank you both for those solutions. This has now progressed int
something slightly different and after trying to modify your solution
above to make this work, still having issues.

What the desired result has now become...
If the user has cell M3 selected, then change cell S8 to show the dat
in cell K57. If the user has cell M5 selected, change cell S8 to sho
the data in cell K58...and so on.

Here is what I have that is not working.

Sub FieldTip()
If ActiveCell.Value = ("M3") Then Range("S8").Value = ("K57")
Else: If ActiveCell.Value = ("M5") Then Range("S8").Value
("K58")
Else: Range("S8").Value = " "
End If
End Sub

I attemped to first change the existing sub however it seems tha
Private Sub Worksheet_SelectionChange(ByVal Target As Range) will no
allow If Then statements. Might have been an error on my part whe
attempting to code however. Any help would be greatly appreciated.

~RBHick

--
Message posted from http://www.ExcelForum.com

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
Excel cell value equals selected text from Word sarahphonics Excel Discussion (Misc queries) 0 April 19th 10 04:15 PM
If a cell equals _, at the next row that equals _, return value fr CathyH Excel Worksheet Functions 10 May 2nd 07 07:53 PM
If cell is left blank, or equals zero, then cell equals a different cell John McMurry Excel Discussion (Misc queries) 3 April 13th 07 01:14 PM
if a:a (range) equals january and c:c equals gas then add g:g ($) BCOz Excel Worksheet Functions 4 December 29th 05 07:40 PM
custom filter does not work when selecting 'equals' X AND 'equals' plindman Excel Discussion (Misc queries) 1 June 1st 05 11:29 PM


All times are GMT +1. The time now is 03:52 PM.

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

About Us

"It's about Microsoft Excel"