View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jim Feaver Jim Feaver is offline
external usenet poster
 
Posts: 16
Default Removing dashes in entire column using VBA

Hi:

Here is a revised Worksheet_Change event procedure.
And paste that involves column K will call
the RemoveDashes procedure.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Cleanup
If Not (Intersect(Target, Range("K:K")) Is Nothing) Then
Application.EnableEvents = False
RemoveDashes
End If
Cleanup:
Application.EnableEvents = True
End Sub

hth,
Jim Feaver
"sup191 " wrote in message
...
I updated the code and everything seems to be working smoothly. Thanks
again! :)

I do have one question though and don't know if it can be done. The
removal of dashes works perfectly for data entered directly into column
K, or pasted into column K. However, it doesn't remove the dashes when
doing a block paste. If I try pasting columns J & K at the save time,
the dashes remain in column K. I'm assuming that column J is the
active column since I put the cursor on J1 and paste - column K gets
filled in, but since it's not the "active" column, it isn't being seen
by the code.

Is that sorta right? Do I make sense? This stuff is going to age me
quickly, but it's so much fun!! ;)


---
Message posted from http://www.ExcelForum.com/