+ Reply to Thread
Results 1 to 9 of 9

Automatically Changing Copy Range in Macros

  1. #1
    Registered User
    Join Date
    10-23-2008
    Location
    Florida
    Posts
    16

    Automatically Changing Copy Range in Macros

    In my program I have data coming from an outside workbook. The amount of data coming into my program changes (Additional Rows) could be more or less. What I want is for the macro to recogize the change in data size and copy the new amount automatically. ie Change copy range. I would post the program but it is proprietary.
    Thanks
    Last edited by jfoote; 03-26-2009 at 10:15 AM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Automatically Changing Copy Range in Macros

    Hi

    1) Have you tried the last suggestion about selecting the range?
    2) Will the other workbook be opened?
    3) Is there a column that can be relied on to have a value in the last row of the data?

    You haven't really given us much to go on to try to assist in solving your problem. Perhaps if you set up a couple of sample files, or give some more detail on your structure, you may get a meaningful response.

    rylo

  3. #3
    Registered User
    Join Date
    10-23-2008
    Location
    Florida
    Posts
    16

    Re: Automatically Changing Copy Range in Macros

    Sorry for not giving enough information. I will try to explain better and attached a workbook with this response.

    In the workbook attached I am trying to copy and paste the transactions in the yellow box in row 6 to the next sheet in row b4. I have added the blue box to show how the transactions will move if more are added. There will only be a maximum of fifteen rows to be copied and I do not want anything but row six in the yellow or 6 through 8 in the blue. I am guessing this a dynamic range but I am not very strong in VBA.

    Thanks in advance
    Attached Files Attached Files
    Last edited by jfoote; 03-23-2009 at 01:30 PM.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Automatically Changing Copy Range in Macros

    Hi

    Can't see either yellow or blue cells in the example file....


    rylo

  5. #5
    Registered User
    Join Date
    10-23-2008
    Location
    Florida
    Posts
    16

    Re: Automatically Changing Copy Range in Macros

    The yellow was the information on the left and the blue was the information on the right. Not to sure what happened. Sorry for the problem.
    Attached Files Attached Files
    Last edited by jfoote; 03-23-2009 at 10:20 PM.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Automatically Changing Copy Range in Macros

    Hi

    So you want a dynamic range, starting in row 6, and ending 2 rows above the row containing Day Trade Profit and Loss in column E???

    rylo

  7. #7
    Registered User
    Join Date
    10-23-2008
    Location
    Florida
    Posts
    16

    Re: Automatically Changing Copy Range in Macros

    Yes I believe that is right.
    Thank you

  8. #8
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Automatically Changing Copy Range in Macros

    Hi

    See if this gets you going.

    Please Login or Register  to view this content.
    rylo

  9. #9
    Registered User
    Join Date
    10-23-2008
    Location
    Florida
    Posts
    16

    Re: Automatically Changing Copy Range in Macros

    That worked perfect!! Thank you very much!!!

+ 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