+ Reply to Thread
Results 1 to 14 of 14

Macro paste

  1. #1
    Registered User
    Join Date
    09-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Unhappy Macro paste

    Hi Guys,

    I need a macro to get the values from cells D29 and H24 in the Resource Calculator sheet and populate it into cells N8 and O8 in the Input form.

    Users will then be able to change the information in the calculator and click the macro again to populate N9 and O9 and so on.

    Is there a way to do this?

    I've attached the file for you to see.

    Thanks.

    Nujwaan.
    Attached Files Attached Files
    Last edited by nujwaan; 09-17-2009 at 09:59 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 paste

    data starts in N14 of he input form
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Macro paste

    Hey Roy,

    Sorry that's what i meant.

    Just insert some rows to include that title.

    Can you help?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro paste

    Assign this code to the button the calculator sheet
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Macro paste

    Hey Roy,

    It didn't seem to work.

    Just to clarify - what I need is the button to be click and the values from cells D29 and H24 in the Calculator to be pasted in Cells N13 and O13 respectively.

    I then need to be able to change the data in the calculator to create new values and then click the button again to populate N14 and O14.

    For some reason when I run the code you gave me it gives a dialog box but seems to be getting the value "ERS" and placing it in N13 with no other result.

    nujwaan

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro paste

    As I said- the code should be assigned to a button on the calculator sheet

  7. #7
    Registered User
    Join Date
    09-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Macro paste

    I love you Roy.

    I really do.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro paste

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  9. #9
    Registered User
    Join Date
    09-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Macro paste

    Hi roy,

    Just a quick question on top of this.

    If I want to make the code so that the button will only populate in columns N and O then how would I do this to prevent people from clicking the button and populating other columns?

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro paste

    Quote Originally Posted by nujwaan View Post
    Hi roy,

    Just a quick question on top of this.

    If I want to make the code so that the button will only populate in columns N and O then how would I do this to prevent people from clicking the button and populating other columns?
    The code only writes to N & O

  11. #11
    Registered User
    Join Date
    09-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Macro paste

    Hi Roy,

    The code only seems to write to N and O if they are the cells that are selected. I was thinking it might be possible to stop people from having cell M14 selected and then clicking the macro button.

    If i have M14 selected it pastes the details into N15 and O15.

    Thanks.

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro paste

    I don't know what you mean. The code writes only to Columns N & O
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    07-28-2009
    Location
    Orange County, CA
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: Macro paste

    it seems njwaan is saying that even though the macro is pasting into Column N and Column O
    the row it pastes into is being based on the active cell.

    Ie: if M14 is selected then the macro pastes into N15 and O15 instead of the desired location of: N13 and O13 initially, when a form of loop off set so that when the macro is used repeatedly it will off set the results down the columns of the first sheet.


    njwaan i hope i am expressing your concerns accurately.

  14. #14
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro paste

    The code copies the cell values to the next empty row in Columns N & O. I have tested it before posting.

    The code is attached to Button 3 on the calculator sheet, captined "Copy information to Input Form"
    Attached Files Attached Files
    Last edited by royUK; 09-17-2009 at 12:28 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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