View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Automatic addition of Text

You are allowed only one type of each event in a worksheet.

So, no you cannot paste in under previous event.


Gord Dibben MS Excel MVP

On Sat, 17 Jan 2009 05:55:01 -0800, stew
wrote:

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