+ Reply to Thread
Results 1 to 3 of 3

VBA Copy a range of cells values using the range of cells in a formula (which will change)

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2003
    Posts
    23

    VBA Copy a range of cells values using the range of cells in a formula (which will change)

    I want to be able to extract the range from a sum formula and then copy that range to a new column
    Given that this cell range will constantly change,

    Formula in cells are:
    Cell A1 Sum(A1:A28)
    Cell A2 Sum(A2:A29)
    Cell A3 Sum(A3:A30)
    ETC....

    Sub aa()
    Dim x As Long
    Dim y As Long
    Dim z As Long
    z = minimum cell in range in A:A select cell
    x = Select the first number from formula in active cell
    y = Select the second number from formula in active cell
    Range("A" & x & ":A" & y).Copy Range("b1")
    End Sub

    The above text in bold is what im looking for

    Any help is greatly appreciated.

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: VBA Copy a range of cells values using the range of cells in a formula (which will cha

    did you try to copy the formula cell and PASTELINK to another cell. if you want part of the result of the formula give a few examples
    Last edited by venkat1926; 05-31-2012 at 02:20 AM.
    I am not an expert. better solutions may be available
    [email protected]

  3. #3
    Registered User
    Join Date
    05-30-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: VBA Copy a range of cells values using the range of cells in a formula (which will cha

    Example

    =sum(A2:A101)


    Copy cell range A2:A101 To Cell B2

    Or

    =sum(A20:A1010)

    Copy cell range A2:A101 To Cell B2

+ 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