LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Fixed Text-Private Sub Worksheet_Change(ByVal Target As Excel.Rang

Quill,

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

If Target.Cells.Count 1 Then Exit Sub
If Len(Target.Value) 0 Then Exit Sub

Application.EnableEvents = False
If Target.Address = "$B$5" Then Target.Value = "Enter Something"

If Target.Address = "$B$6" Then Target.Value = "Enter New Code"
If Target.Address = "$C$1" Then Target.Value = "Enter Old Code"
If Target.Address = "$C$2" Then Target.Value = "Enter Old Code"
'And so on......
' I hope you can see the logic
Application.EnableEvents = True
End Sub

HTH,
Bernie
MS Excel MVP


" wrote in message
...
I have attached below and the result in Cell B5=Enter Something

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$B$5" Then
If Len(Target.Value) = 0 Then Target.Value = "Enter Something"
End If
End Sub

Question: In Cell B6 can I use some kind of formula resulting in "Enter New
Code" along with the same formula above.

Meaning:
Same worksheet:
B5=Enter Something
B6=Enter New Code

Additional: Example of Result
Same worksheet:
B5=Enter Something
B6=Enter New Code
C1 to C2=Enter Old Code
E1=Help Me.

Thanks a bundle.
Quill666



 
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
Control Toolbox and Private Sub Worksheet_Change(ByVal Target As R [email protected] Excel Discussion (Misc queries) 1 August 17th 07 09:38 AM
Private Sub Worksheet_Change(ByVal Target As Excel.Range) Arturo Excel Programming 5 March 9th 07 04:30 PM
Private Sub Worksheet_Change(ByVal Target As Excel.Range) [email protected] Excel Worksheet Functions 0 December 21st 06 02:13 AM
Private Sub Worksheet_Change(ByVal Target As Range) pd1234321 Excel Programming 5 December 8th 06 04:11 AM
Private Sub Worksheet_Change(ByVal Target As Range) Arturo Excel Programming 1 May 25th 05 03:32 PM


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