+ Reply to Thread
Results 1 to 10 of 10

Cycle Through A Series of Worksheets & Insert Rows, Then Special Paste Data

  1. #1
    Registered User
    Join Date
    12-18-2012
    Location
    Miami, Florida
    MS-Off Ver
    Excel 2007
    Posts
    61

    Cycle Through A Series of Worksheets & Insert Rows, Then Special Paste Data

    Good afternoon, I need assistance with the following:

    1) I have many worksheets that I need to cycle through - only the ones’ that read “wk1 thru wk52.”
    2) I need to loop through WK1 thru WK52 only and insert 23 rows in the same cell (A64) on each sheet.
    3) Then, I need to copy a range name “Weekly_Add_Data” (A87:AA109) - goes to the clipboard.
    4) Lastly, I need to Special Paste (all – formats, formulas, links, etc.) range name – “Weekly_Add_Data” back to cell A64.

    Your assistance with this, is greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Cycle Through A Series of Worksheets & Insert Rows, Then Special Paste Data

    I can help you with the first one

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-18-2012
    Location
    Miami, Florida
    MS-Off Ver
    Excel 2007
    Posts
    61

    Re: Cycle Through A Series of Worksheets & Insert Rows, Then Special Paste Data

    Thanks a bunch for your contribution. I will test now.

  4. #4
    Registered User
    Join Date
    12-18-2012
    Location
    Miami, Florida
    MS-Off Ver
    Excel 2007
    Posts
    61

    Re: Cycle Through A Series of Worksheets & Insert Rows, Then Special Paste Data

    Hello AB33,

    I ran and tested above subroutine. It kicked an error, so I declared "sh" as an Object Variable. When I tested again on my test workbook, it ran but did nothing to the sheets.

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Cycle Through A Series of Worksheets & Insert Rows, Then Special Paste Data

    This should answer 3 and 4. I added onto AB33's solution for 1 and 2. If the "like" method doesn't work you could always try instr
    Please Login or Register  to view this content.
    Last edited by stnkynts; 12-26-2012 at 07:15 PM.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Cycle Through A Series of Worksheets & Insert Rows, Then Special Paste Data

    Well, I have tested it on sample and did work. Declaring Object Variable should not make any difference to running of the code. I think it would be easy for us to test the code if you could attach a sample of your book. We are working from your description, but not actual data.

  7. #7
    Registered User
    Join Date
    12-18-2012
    Location
    Miami, Florida
    MS-Off Ver
    Excel 2007
    Posts
    61

    Re: Cycle Through A Series of Worksheets & Insert Rows, Then Special Paste Data

    Attached is the requested file.Upload - Test Line 1 Data.xlsm

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Cycle Through A Series of Worksheets & Insert Rows, Then Special Paste Data

    I will have a look, but i know the issue- case senstive. I had lower case and you have upper case

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Cycle Through A Series of Worksheets & Insert Rows, Then Special Paste Data

    This should work. Sorry, earlier you were right on variables as you have option explict on your code

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    12-18-2012
    Location
    Miami, Florida
    MS-Off Ver
    Excel 2007
    Posts
    61

    Re: Cycle Through A Series of Worksheets & Insert Rows, Then Special Paste Data

    It worked great! Thanks a bunch to both of you for your expertise. You are excellent inspiration.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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