Hey, guys,
Let's say I have vendors' names on column A and I wish to create a sheet for each vendor. However, the macro must also be able to check if there's a sheet with that name already.
Right now, I'm struggling to name the new worksheet:
I wouldn't like you to provide me a full macro. Instead, I would appreciate hits so I can get there by myself.
Kind regards,
ORoxo
EDIT: Ok, I overcame the problem with the name of the sheets. Now I need an If structure to ignore if there's already a sheet with that word.
Let's say I have vendors' names on column A and I wish to create a sheet for each vendor. However, the macro must also be able to check if there's a sheet with that name already.
Right now, I'm struggling to name the new worksheet:
Code:
Sub test()
Dim r As Integer, lr As Integer, ws As Worksheet
Application.ScreenUpdating = False
lr = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
For r = 2 To lr
Worksheets.Add
ActiveSheet.Name = Sheet1.Cells(r, 1)
Next
Application.ScreenUpdating = True
End Sub
I wouldn't like you to provide me a full macro. Instead, I would appreciate hits so I can get there by myself.
Kind regards,
ORoxo
EDIT: Ok, I overcame the problem with the name of the sheets. Now I need an If structure to ignore if there's already a sheet with that word.
Last edited: