-3

Need a VBA code. rename sheets from list

I have a list of names in sheet 2 cell w3 thru w22. I need to name sheets/tabs 3 thur 22 from the the list of names. The names change. and if no name in w3 thru w22. I want the tabs to be numbered 1 thru 20 Any Ideas?

  • 3
    Stack Overflow is a community-run website where programmers answer questions about **specific coding issues**. Unfortunately, questions asking the community to provide code given a set of specifications are outside the scope of this site. Please see [how to ask](http://stackoverflow.com/help/how-to-ask) and the [help/on-topic] for all the details. – Mathieu Guindon Jun 11 '15 at 22:15

1 Answers1

0
    Dim MyCell As Range, MyRange As Range, Dim i As Integer 

    Set MyRange = Sheets("Summary").Range("w3") 
    Set MyRange = Range(MyRange, MyRange.End(xlDown)) 

    For Each MyCell In MyRange 
    If MyCell.Value IS NULL
    Sheets(Sheets.Count + 3).Name = i
    Sheets(Sheets.Count + 3).Name = MyCell.Value ' renames the new worksheet 
    Next MyCell 

Or something like this maybe, I didn't test it since you didn't give us anything to go off of or make any effort to solve it yourself. http://en.kioskea.net/faq/27361-excel-a-macro-to-create-and-name-worksheets-based-on-a-list Kudos to this website for giving me a basis to go off of.

hypetech
  • 166
  • 1
  • 12
  • Yes I might be a little lame. Just can't seem to figure it out. Thank you for your answer. – Thayne Greene Jun 12 '15 at 00:21
  • It's ok, just read the link Mat's Mug sent you and it'll help you learn how to ask much better questions. Everyone has to learn and practice :) – hypetech Jun 12 '15 at 14:44