Creating sheet with list having duplicate values.
Closed
sandesh_dbz
Posts
1
Registration date
Thursday 22 October 2015
Status
Member
Last seen
23 October 2018
-
22 Oct 2015 à 09:44
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 22 Oct 2015 à 11:21
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 22 Oct 2015 à 11:21
Related:
- Outlook duplicate remover
- Outlook duplicate items remover (odir) - Download - Email
- How to refresh outlook - Guide
- Wga remover - Download - Cleaning and optimization
- Out of office outlook app - Guide
- Trojan remover free - Download - Antivirus
2 responses
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
22 Oct 2015 à 11:07
22 Oct 2015 à 11:07
could you share what you have done so far
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
22 Oct 2015 à 11:21
22 Oct 2015 à 11:21
Hi Sandesh_dbz,
Try the following code:
How to implement and run a code:
- From Excel hit Alt + F11 to open the "Microsoft Visual Basic" window.
- Go to the top menu in the newly opened window > Insert > Module.
- Paste the code in the big white field.
- You can now close this window.
- Back at Excel, hit Alt + F8 to display the available macro's.
- Double-click the macro you wish to run.
NOTE: macro's cannot be reversed using the blue arrows. Always make sure you save your file before running a code, so you can reopen your file if something unforeseen happens or you want to go back to the situation before the code was run.
Best regards,
Trowa
Try the following code:
Sub RunMe()
Dim lRow As Integer
lRow = Range("A" & Rows.Count).End(xlUp).Row
For Each cell In Range("A2:A" & lRow)
If WorksheetExists(cell.Value) = True Then
Sheets(cell.Value).Copy after:=Sheets(Sheets.Count)
Else
Sheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = cell.Value
End If
Next cell
End Sub
Public Function WorksheetExists(ByVal WorksheetName As String) As Boolean
On Error Resume Next
WorksheetExists = (Sheets(WorksheetName).Name <> vbNullString)
On Error GoTo 0
End Function
How to implement and run a code:
- From Excel hit Alt + F11 to open the "Microsoft Visual Basic" window.
- Go to the top menu in the newly opened window > Insert > Module.
- Paste the code in the big white field.
- You can now close this window.
- Back at Excel, hit Alt + F8 to display the available macro's.
- Double-click the macro you wish to run.
NOTE: macro's cannot be reversed using the blue arrows. Always make sure you save your file before running a code, so you can reopen your file if something unforeseen happens or you want to go back to the situation before the code was run.
Best regards,
Trowa