G
Guest
Guest
I have a VBA routine where I need to add and rename worksheets. I have a list of names and some date for each name, and new names and data are added each week. When a new name is encountered, the code creates a new worksheet for that person. The new worksheets are automatically named "Sheet 1", "Sheet 2", "Sheet 3" etc.
The problem occurs when I try to rename the new worksheets. My code works fine for the first one but times out on the second and subsequent ones (I never know how many there are going to be). What I need is a way to change the name of the new worksheet when I don't know its current name.
The problem occurs when I try to rename the new worksheets. My code works fine for the first one but times out on the second and subsequent ones (I never know how many there are going to be). What I need is a way to change the name of the new worksheet when I don't know its current name.