Marsman
Board Regular
- Joined
- May 13, 2013
- Messages
- 62
- Office Version
- 365
- Platform
- Windows
I have a need for multiple users to work on a shared spreadsheet that will copying and pasting in account numbers.
with that said - what code could i use to place into the spreadsheet that would strip the first four digits of the number once they have pasted it into a particular column?
example...
in Column E the user would past in 1234567890123456
once they do that either CTRL V or Right Mouse click and Paste of the above number to end up with the result of 567890123456.
Code I am currently using depends on a manual run of a Macro but I would like to have it automatically do it...
with that said - what code could i use to place into the spreadsheet that would strip the first four digits of the number once they have pasted it into a particular column?
example...
in Column E the user would past in 1234567890123456
once they do that either CTRL V or Right Mouse click and Paste of the above number to end up with the result of 567890123456.
Code I am currently using depends on a manual run of a Macro but I would like to have it automatically do it...
VBA Code:
Sub test()
Dim c As Range
For Each c In Range("E2:E" & Range("E" & Rows.Count).End(xlUp).Row)
If Left(c, 2) Like "####" Then c = Mid(c, 3)
Next
End Sub