LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default ActiveCell and TextBox

One more question, this method works fine but doesnt work on merged
cells. any ideas?


nickm687 wrote:
Brilliant, works perfectly.

Thank you
Nick


Tom Ogilvy wrote:
Right click on the worksheet tab and select view code. In the left dropdown
at the top of the module select Workbook. From the right dropdown at the
top of the module select SelectionChange. You will get a event procedure
declaration like this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

This will fire each time you change the selection, so you can use it to
update your textbox

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Address(0,0)
Case "C1"
ActiveSheet.TextBox1.Value = "One"
Case "D3", "F1", "M12"
ActiveSheet.Textbox1.Value = "Two
Case Else
ActiveSheet.TextBox1.Value = ""
end Select
End Sub

--
Regards,
Tom Ogilvy

"nickm687" wrote in message
ps.com...
I have on my worksheet a textbox that i want to display a message
depending on which cell is highlighted.

im using this code for the updatung of the text box
ActiveSheet.TextBox1.Object.Value = "message"

depending on which cell is selected a different message will be shown.

thanks in advance
nick


 
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
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
ActiveCell changes contents of TextBox [email protected] Excel Programming 4 September 1st 06 06:25 PM
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys Minitman[_4_] Excel Programming 0 February 22nd 05 08:50 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:47 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:43 PM


All times are GMT +1. The time now is 07:14 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"