+ Reply to Thread
Results 1 to 15 of 15

copy pastespecial loop

  1. #1
    Registered User
    Join Date
    08-31-2009
    Location
    washington, dc
    MS-Off Ver
    Excel 2003
    Posts
    55

    copy pastespecial loop

    Hello,

    The following macros will:

    I'm desperate for a copy paste macros that will:

    1) Copy H3:H143 (141 rows) from "Sheet 1" and place this on "Sheet 2" on D4:D144 (141 rows)

    2) Copy I:3:I143 (141 rows) from "Sheet 1" and place this on "Sheet 2" on I4:I144 (141 rows)

    So, in essence, it will copy every single column across on "Sheet 1", but will paste every 5 columns on "Sheet 2" .


    It will then loop 33 times to continually copy and paste across columns.

    Please Login or Register  to view this content.

    My only problem is that it is not finished:

    I need the same "Sheet 1" information pasted to "Sheet 3", "Sheet 4", "Sheet 5", and "Sheet 6". In the same format (every single column across on "Sheet 1", but will paste every 5 columns on "Sheet 3", "Sheet 4", "Sheet 5" and "Sheet 6"


    With that in mind, as the financial data is "Sheet 1" is copied, I need it to be pasted 3.5% higher than it was copied from.........So that Sheet 2 will be 3.5% higher than sheet 1, Sheet 3 will be 3.5% higher in sheet 2, and so forth.

    I also need it to paste special values because it is currently pasting formulas instead of values.


    Any suggestions?

    Thank you

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Need help with a copy.paste special loop

    I suggest you attach a sample workbook to save anyone here having to spend time mocking something up. Not all of us are clever enough to write ad hoc code without testing.

  3. #3
    Registered User
    Join Date
    08-31-2009
    Location
    washington, dc
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Need help with a copy.paste special loop

    Here is a sample
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Need help with a copy.paste special loop

    Give this a whirl. I put the factor in A1 of each sheet assuming you don't use that cell, but modify if you do.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-31-2009
    Location
    washington, dc
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Need help with a copy.paste special loop

    Hey thanks for the quick reply!

    I think my problem is that Sheets 2 through Sheets 6 will not be those actual sheet names. They will actually be called:

    "Year 1 Ceiling Rates", "Year 2 Ceiling Rates", "Year 3 Ceiling Rates", ....., "Year 5 Ceiling Rates".

    The "Sheet 1" information that is being copied is actually called "Sheet 1" but will not be at the beginning of the tabs. It will be located at the end of the tabs.


    Any suggestions?

  6. #6
    Registered User
    Join Date
    08-31-2009
    Location
    washington, dc
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Need help with a copy.paste special loop

    There will also be other random tabs in the mix so I'm not sure if

    Please Login or Register  to view this content.
    \

    will work?

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Need help with a copy.paste special loop

    Which is why it helps if you attach a workbook which represents your actual file. Do that, and I will amend the code.

  8. #8
    Registered User
    Join Date
    08-31-2009
    Location
    washington, dc
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Need help with a copy.paste special loop

    you mind if i send to your email?

  9. #9
    Registered User
    Join Date
    08-31-2009
    Location
    washington, dc
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Need help with a copy.paste special loop

    It wont upload the sample file is too large....

    And I cannot delete the pertinent data because it is password protected...

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need help with a copy.paste special loop

    A continuation of our original thread...

    Just edit the "array" you see listed, put the sheets you want copied TO in there in the order you want.
    Please Login or Register  to view this content.

    NOTE: No more crossposting without including links.
    Last edited by JBeaucaire; 09-16-2009 at 12:37 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  11. #11
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need help with a copy.paste special loop

    Code above updated and second loop removed. Use updated code. (9:37am)
    Last edited by JBeaucaire; 09-16-2009 at 12:37 PM.

  12. #12
    Registered User
    Join Date
    08-31-2009
    Location
    washington, dc
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Need help with a copy.paste special loop

    Thanks JB. I put in the necessary values in the array and it worked out.. Except,

    The sheets in the array are password protected. The only place I can paste values are in the 141 Rows (after every fifth column) I had defined.

    Your very first macro from last night allowed me to copy and paste into the correct columns....it did it perfectly...just needed to add paste values.


    Now it is not working and saying that the worksheet is protected.



    Would you have any suggestions?

    Thank you in advance.....i hate password protection
    Last edited by copleyr; 09-16-2009 at 01:22 PM.

  13. #13
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Need help with a copy.paste special loop

    So I wasted precious minutes of my life helping you with a problem you'd posted elsewhere, which is incidentally against the rules.

  14. #14
    Registered User
    Join Date
    08-31-2009
    Location
    washington, dc
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Need help with a copy.paste special loop

    No, it was a continuation of the original post I had posted in this thread.

    The last thread is closed.

    I appreciate your help.

  15. #15
    Registered User
    Join Date
    08-31-2009
    Location
    washington, dc
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: copy pastespecial loop

    I guess I'm SOL

+ Reply to Thread

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