hopeless88
New Member
- Joined
- Mar 19, 2014
- Messages
- 1
I relatively new to VBA so not exactly sure of the best way to achive this:
I am trying to anonymise a column of data. I need to replace all letters in the cell with an * apart from the first letter.
I have tried this:
Sub AnonymiseCAR()
Dim CounterCAR
Dim ClientName As String
'Select CAR Worksheet
Worksheets("RAW DATA - CAR").Activate
CounterCAR = 2
Do
ClientName = "E" & CounterCAR
If ClientName = "" Then
Exit Do
Else
Replace(ClientName,*,"*",2)
CounterCAR = CounterCAR + 1
Loop
However I get a Compile error for the Replace line because of a Syntax error.
Any suggestions on how to do this would be great!
Thanks
I am trying to anonymise a column of data. I need to replace all letters in the cell with an * apart from the first letter.
I have tried this:
Sub AnonymiseCAR()
Dim CounterCAR
Dim ClientName As String
'Select CAR Worksheet
Worksheets("RAW DATA - CAR").Activate
CounterCAR = 2
Do
ClientName = "E" & CounterCAR
If ClientName = "" Then
Exit Do
Else
Replace(ClientName,*,"*",2)
CounterCAR = CounterCAR + 1
Loop
However I get a Compile error for the Replace line because of a Syntax error.
Any suggestions on how to do this would be great!
Thanks