+ Reply to Thread
Results 1 to 4 of 4

Macro: calculate and paste repeatedly

Hybrid View

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

    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 09:51 AM.

  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: Macro: calculate and paste repeatedly

    Why would you want a macro to do this. Formulas would be simpler
    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 Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    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
    England
    MS-Off Ver
    Excel 2007
    Posts
    33

    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.6.0 RC 1