Results 1 to 2 of 2

Thread: Help Understanding Code Dealing with Creating New Spreadsheets

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Help Understanding Code Dealing with Creating New Spreadsheets

    I'm trying to decipher a portion of code. The workbook already has a sheet X. When the code gets to this point it creates a new sheet called X and I get an error stating that I can't name a new sheet the same name as an existing sheet. Can someone help me to understand what this code seems to be trying to do and why i might be getting that error? Thanks!

    For i = 1 To Worksheets(SheetA).Range("B3").Value

    Sheets("X").Select
    Sheets("X").Copy After:=Worksheets(Worksheets.Count)
    ActiveSheet.Name = Worksheets(SheetB).Cells(i + 1, 1)
    Last edited by yerromnitsuj; 09-12-2011 at 09:53 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •