Hi all,
I want a macro which can give single name to all similar data in a column. Sample data provided below:
ABC.com
ABC.com
ABC.com
Xyz.llb
Xyz,tz
Gisp inc
Gisp tpo
After running the macro, the excel data in selection to be displayed like:
ABC
ABC
ABC
Xyz
Xyz
Gisp
Gisp
For this purpose, I have included a userform having a listbox to display the data in selection. Find the code below.
Private Sub UserForm_Initialize()
Dim cell As Range
Dim Rng As Range
Set Rng = Application.Selection
For Each cell In Rng
ListBox1.AddItem cell.Value
Next cell
End Sub
Additionally, the userform following commandButtons
commandbutton1 (for rename)
commandbutton2 (next)
commandbutton3 (previous)
commandbutton4 (exit)
Please see the steps below that have to be followed one after another during execution.
1. After running macro listbox of the userform should display all unique entries which started with alphabet A
2. clicking the ‘next’ button the listbox displays all entries which started with next alphabet B and so on.
3. ‘previous’ button work opposite to the ‘next’ button
4. The listbox allows multiselection of the displayed entries
5. after multiple selection and clicking ‘rename’ button, an inputbox will appear which contains the first entry in the listbox selection
6. The user can edit the entry in the inputbox
7. After user input, all the entries in listbox selection replaced with the user inputted data and same is also changed in the backend data (excel data in selection)
8. the ‘exit’ button causes unloading of the userform.
Please help me with code for this macro. Looking forward in anticipation.
I want a macro which can give single name to all similar data in a column. Sample data provided below:
ABC.com
ABC.com
ABC.com
Xyz.llb
Xyz,tz
Gisp inc
Gisp tpo
After running the macro, the excel data in selection to be displayed like:
ABC
ABC
ABC
Xyz
Xyz
Gisp
Gisp
For this purpose, I have included a userform having a listbox to display the data in selection. Find the code below.
Private Sub UserForm_Initialize()
Dim cell As Range
Dim Rng As Range
Set Rng = Application.Selection
For Each cell In Rng
ListBox1.AddItem cell.Value
Next cell
End Sub
Additionally, the userform following commandButtons
commandbutton1 (for rename)
commandbutton2 (next)
commandbutton3 (previous)
commandbutton4 (exit)
Please see the steps below that have to be followed one after another during execution.
1. After running macro listbox of the userform should display all unique entries which started with alphabet A
2. clicking the ‘next’ button the listbox displays all entries which started with next alphabet B and so on.
3. ‘previous’ button work opposite to the ‘next’ button
4. The listbox allows multiselection of the displayed entries
5. after multiple selection and clicking ‘rename’ button, an inputbox will appear which contains the first entry in the listbox selection
6. The user can edit the entry in the inputbox
7. After user input, all the entries in listbox selection replaced with the user inputted data and same is also changed in the backend data (excel data in selection)
8. the ‘exit’ button causes unloading of the userform.
Please help me with code for this macro. Looking forward in anticipation.