Add Number Sheets Based on Cell Value

  • In one cell I had the number five and as a result, I needed five new worksheets added to the file how would I do this:


    I don't know if this will work, but something like this:


    Code
    'A1 = 5
    i = A1
    
    
    For each i in Column a
      Worksheets.add
    sheet.name = "Sales Order" & i 'naming the new worksheet
    Next


    thanks in advance

  • You could use


  • The first procedure you need to pass a value to, so you can call it from other procedures, the second one was an example of how to use the first procedure

  • thanks bnix


    After I sent that email, I realized that you were calling the procedure.


    One more thing, I was trying to change the variable used to name the sheet. When I tried to run it, I got an error message. I replaced the "Sales Order" & i with "Sales Order" & n--where n is equal to a certain value.


    Why wasn't mine working.


    thanks

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!