View Single Post
  #4   Report Post  
Paul Sheppard
 
Posts: n/a
Default


MarcusA Wrote:
Paul,

I have the same scenario however, I have established a list of the
account
numbers on a seperate sheet. How can I refer back to that sheet using
your
macro?

Hi Marcus

Try this, sorry it is not my code so I cannot explain how it works

Sub namesheets()
Dim arr As Variant
arr = Range("a2:a10").Value
For i = LBound(arr) To UBound(arr)
Sheets(i + 1).Activate
Sheets(i).Name = arr(i, 1)
Next i
End Sub

You will need to change the range to suit your data, line 3 currently
a2:a10
this will name the first 9 sheets in the workbook, so if you dont want
the worksheet with your account numbers renamed make sure it is to the
right of those you do want to rename

Save your file with a different name and have a play



--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile: http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=392169