+ Reply to Thread
Results 1 to 3 of 3

Incrimenting Macro References

  1. #1
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    Incrimenting Macro References

    Hi Guys,

    I need to produce a bit of code which will copy parts of data stored in one sheet into several other workbooks.

    The code below is the macro to copy and paste one piece of data, i need this to loop and increment copied row numbers by 2 and increment the paste workbook name by 1.

    Hopefully the code will explain it better:

    here is what i am lookin to do:

    Please Login or Register  to view this content.

    I have one main sheet and several secondary sheets named as follows

    Copy (1) of Account
    Copy (2) of Account
    Copy (3) of Account

    I need the MAcro to copy the data from the relevant row in the Main sheet, into the relevant cells in the secondary sheet, save the sheet, exit, then repeat on Row+1 of main sheet until row 510.


    eg: First Run:

    Copy data from Row 4 on main sheet and paste to Copy (1) of Account.xls

    Second run:

    Copy data from Row 6 on main sheet and paste to Copy (2) of Account.xls

    Repeat until......

    Thank you for any help in advance

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Incrimenting Macro References

    It's not clear which workbook yo are copying from.

    Your code would be much more efficient if you didn't select the ranges.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    Re: Incrimenting Macro References

    hi roy, sorry i'm not very competent in VBA,

    I am copying data from spreadsheet: master sheet.xls which holds many records, and I am transferring these records to there own spreadsheets- Copy (1) of account.xls ....... Copy (500) of Account.xls

    Hope this makes it a bit clearer

+ 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