Hi,
Let me thank you first to forum contributors for all help posted here.
I would like to write a VBA code to achive on attachement.
Thanks
Hi,
Let me thank you first to forum contributors for all help posted here.
I would like to write a VBA code to achive on attachement.
Thanks
This code should do it as you need.
[VBA]Option Explicit
Const e1 As String = ".com", e2 As String = ".co.uk", e3 As String = ".co.in"
Public Sub UpdateDomain()
Dim sDomain As String
Dim vDomain As Variant
Dim i As Integer
Range("D2" & Range("D" & Rows.Count).End(xlUp).Row + 1).ClearContents
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
vDomain = Split(Range("A" & i).Value2, ".")
sDomain = vDomain(LBound(vDomain))
Range("D" & Range("D" & Rows.Count).End(xlUp).Row + 1).Value = sDomain & e1
Range("D" & Range("D" & Rows.Count).End(xlUp).Row + 1).Value = sDomain & e2
Range("D" & Range("D" & Rows.Count).End(xlUp).Row + 1).Value = sDomain & e3
Next i
End Sub
[/VBA]
Regards,
--------------------------------------------------------------------------------------------------------
Shrivallabha
--------------------------------------------------------------------------------------------------------
Using Excel 2016 in Home / 2010 in Office
--------------------------------------------------------------------------------------------------------
...
...
...
(sol. posted already)
PLS DO NOT PM; OPEN A THREAD INSTEAD!!!
1) Posting Code
[CODE]PasteYourCodeHere[/CODE]
(or paste your code, select it, click # button)
2) Uploading File(s)
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.
3) Testing the Codes
always back up your files before testing the codes.
4) Marking the Thread as Solved
from Thread Tools (on the top right corner, above the first message)