+ Reply to Thread
Results 1 to 5 of 5

How to define Variables as Ranges and Copy them?

  1. #1
    Registered User
    Join Date
    05-31-2012
    Location
    Groenlo, Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    64

    How to define Variables as Ranges and Copy them?

    I want to create a Macro to be able to prepare a NEW Offer/Calculation based on an OLD Offer/Calculation.
    I use 3 Tabs in Excel for this:
    Tab 1: Contains the old calculation
    Tab 2: Should contain the new calculation
    Tab 3: Contains info about how a position in the old calculation matches a position in the new calculation.

    Tab 3 is added as an attachment.

    In the table A5:F22 of TAB3 the following info is given:
    A the position number of the new calc
    F the Range of the old calc [Tab3] that should be copied for this position.
    C the cell in [Tab2] where the the calculation should be pasted (at least the cell where the range should start)

    How can I create a Macro to do the following
    Copy the range from TAB1 defined in TAB3 Cel F5
    Paste the range starting in the Cel defined on TAB2 defined in TAB3 Cel C5
    Then give the Cel on TAB2 defined in TAB3 Cel C5 the value of A5

    Move on to the next row until No Values are defined in rows C and F
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-31-2012
    Location
    Groenlo, Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    64

    Re: How to define Variables as Ranges and Copy them?

    This is what I have so far:

    Please Login or Register  to view this content.
    Last edited by Dubrock; 03-15-2014 at 06:00 PM.

  3. #3
    Registered User
    Join Date
    05-31-2012
    Location
    Groenlo, Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    64

    Re: How to define Variables as Ranges and Copy them?

    Anyone an idea?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to define Variables as Ranges and Copy them?

    Dubroc, please use code tags with your code, thanks
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    05-31-2012
    Location
    Groenlo, Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    64

    Re: How to define Variables as Ranges and Copy them?

    I managed to make the Macro work, but row for row. And its far to slow. Based on the first position which is 20 rows, it would take about 6 hours to do one calculation of about 3000 rows.

    Does anyone have ideas to make the macro significantly faster??

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using variables to define a range
    By Aelyn in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2011, 04:27 AM
  2. Can't find a way to define variables
    By Mole in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2011, 02:42 PM
  3. need help to define a range using two variables
    By dschmitt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2010, 08:14 AM
  4. How to use variables to define range
    By Dolemite in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2005, 02:05 PM
  5. How do you define variables in excel?
    By BigRon in forum Excel General
    Replies: 6
    Last Post: 04-16-2005, 04:06 PM

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