Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rick... Thank you... thank you. This worked perfectly. The string in that
column is always an A or B followed by numbers 1, 2 , 3 or 4. There's no other variation. I appreciate your help. You are a macro programming genius... Nay, a VBA god <G. Again thanks :) "Rick Rothstein (MVP - VB)" wrote in message ... Of course, had I actually posted the code that included the error trapping, that might have been useful.<g Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Column = 3 And Target.Row =6 Then Application.EnableEvents = False Target.Value = Format(Target.Value, "&&&&&-&") Application.EnableEvents = True End If End Sub Remember, the above code is for when there is only one trailing digit... the more general code that I posted in my previous message was complete as posted. Sigh! Yes, as I said, if I **had** posted the code with the error trapping, that would indeed have been useful... Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Column = 3 And Target.Row = 6 Then On Error GoTo CleanUp Application.EnableEvents = False Target.Value = Format(Target.Value, "&&&&&-&") End If CleanUp: Application.EnableEvents = True End Sub Rick |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Plotting multiple Y column data versus single X column in Excel 20 | Charts and Charting in Excel | |||
how to select a single column when this column cross a merged cell | Excel Programming | |||
From single cell variables to a single column serie | New Users to Excel | |||
Copy column range of "single word" cells with spaces to a single c | Excel Discussion (Misc queries) | |||
Return Single Row of Numeric Data to Single Column | Excel Worksheet Functions |