Automatic addition of Text
Worked it out
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 30 And Target.Column < 2 Or Target.Row < 10 Then
Exit Sub
If Target < "" Then
Application.EnableEvents = False
Target = Target & " (Receipt Number " & Target.Row & ")"
Application.EnableEvents = True
End If
End Sub
"Daniel.C" wrote:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 30 Or Target.Row < 10 Then Exit Sub
If Target < "" Then
Application.EnableEvents = False
Target = Target & " (Receipt " & Target.Row & ")"
Application.EnableEvents = True
End If
End Sub
Daniel
Hi Daniel
Sorry I need to exclude Rows 1 thru 9 from the Macro. Can You adapt
Best
Stew
"Daniel.C" wrote:
Yes, unless you want columns B and AD :
If Target.Column < 30 And Target.Column < 2 Then Exit Sub
Daniel
Dear Daniel
Thank You, works a treat. If I wanted the same Facility to Column AD would
the macro look like this and would I just paste in under the Previous Sub?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 30 Then Exit Sub
If Target < "" Then
Application.EnableEvents = False
Target = Target & " (Receipt " & Target.Row & ")"
Application.EnableEvents = True
End If
End Sub
Thanks for your Help
Stewart
"Daniel.C" wrote:
Hi.
Paste the following macro in the sheet module :
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 2 Then Exit Sub
If Target < "" Then
Application.EnableEvents = False
Target = Target & " (Receipt " & Target.Row & ")"
Application.EnableEvents = True
End If
End Sub
HTH
Daniel
Hi All
If I Have a Blank B10 and add text .Can text be added automatically to
the end of that text
ie
"Hotels New York" in B10
Become
"Hotels New York (Receipt 10)"
and
"Hotels New York" in B12
Become
"Hotels New York (Receipt 12)"
Thanks For Looking
Stew
|