Forum Discussion
Guram_Bregadze
Jul 03, 2024Copper Contributor
VBA to create new CSV file from the existing one with modified email address
Hello, I need a VBA which will automatically create a new CSV file from the old one (attached) based on this criteria: Update column email with domain abc.com Email format: first letter from nam...
- Jul 03, 2024
Change
sMail = wsh.Range("B" & r).Value & Left(wsh.Range("C" & r).Value, 1) & _ Split(wsh.Range("C" & r).Value)(1) & "@abc.com"to
sMail = Left(wsh.Range("C" & r).Value, 1) & Split(wsh.Range("C" & r).Value)(1) & _ wsh.Range("B" & r).Value & "@abc.com"
Guram_Bregadze
Jul 03, 2024Copper Contributor
Thank you, Hans!
The problem with this code is that it displays the department_id before the name. I need it to be shown before the @ symbol
HansVogelaar
Jul 03, 2024MVP
Change
sMail = wsh.Range("B" & r).Value & Left(wsh.Range("C" & r).Value, 1) & _
Split(wsh.Range("C" & r).Value)(1) & "@abc.com"
to
sMail = Left(wsh.Range("C" & r).Value, 1) & Split(wsh.Range("C" & r).Value)(1) & _
wsh.Range("B" & r).Value & "@abc.com"
- Guram_BregadzeJul 03, 2024Copper ContributorAwesome! Many Thanks!