Results 1 to 19 of 19

Macro to create multiple sheet, copy certain values and loop until end of row data

Threaded View

  1. #1
    Registered User
    Join Date
    02-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    52

    Thumbs up Macro to create multiple sheet, copy certain values and loop until end of row data

    Hi, guys! I news help on this one. I would like to create a macro to copy sheet, name it based on cells from another sheet. I managed, through research, to execute it through looping. see code below:

    Sub copySheet2()
    Dim rngName As Range
    Dim i As Integer
    Set rngName = ThisWorkbook.Sheets("Sheet1").Range("a1")
    Do Until rngName.Value = ""
    i = ThisWorkbook.Sheets.Count
    Sheets("Sheet2").Copy After:=Sheets(i)
    ThisWorkbook.Sheets(i + 1).Name = rngName.Value
    Set rngName = rngName.Offset(1)
    Loop
    End Sub
    It worked well, however, I also need to link or copy values corresponding to each name before it stops executing e.g. Name, Position from Sheet1. I would appreciate any help. Thanks!
    Last edited by jhoelski; 02-17-2012 at 07:29 AM. Reason: Kudos to Rory!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1