+ Reply to Thread
Results 1 to 4 of 4

Thread: Macro: calculate and paste repeatedly

  1. #1
    Registered User
    Join Date
    02-01-2011
    Location
    Cranfield
    MS-Off Ver
    Excel 2007
    Posts
    19

    Macro: calculate and paste repeatedly

    Hello,

    I would like to create a macro which inputs the value of 100 into cell A2, then copies the calculated contents of cells A7:A17 to a new worksheet (column B). I then want the macro to repeat, increasing the value of A2 by 10 and copying the new values of cells A7:A17 into a new column on the worksheet (column C).... and so on until the value of A2 = 750

    I have attached a sample workbook outling the format

    Thanks alot
    Attached Files Attached Files
    Last edited by Savan87; 11-18-2011 at 08:51 AM.

  2. #2
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,640

    Re: Macro: calculate and paste repeatedly

    Why would you want a macro to do this. Formulas would be simpler
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  3. #3
    Valued Forum Contributor
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    Excel 2010
    Posts
    522

    Re: Macro: calculate and paste repeatedly

    Macro:
    Sub ertert()
    Dim k&, cl&
    
    cl = 2
    With Sheets("Ouput")
        For k = 100 To 750 Step 10
            [a2].Value = k
            .Cells(1, cl).Value = k
            .Cells(2, cl).Resize(11).Value = [a7:a17].Value
            cl = cl + 1
        Next
        .Activate
    End With
    
    End Sub
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-01-2011
    Location
    Cranfield
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Macro: calculate and paste repeatedly

    Thanks for your assistance Nilem

+ 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.2.0