+ Reply to Thread
Results 1 to 8 of 8

How to use a Macro submit button to export results to another worksheet

Hybrid View

  1. #1
    Registered User
    Join Date
    05-17-2013
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to use a Macro submit button to export results to another worksheet

    Hello, thanks for replying.

    The worksheet that users will complete will be the same for all so they won't be completing separate rows. For example, users will open the document and add information to cells B1-B5 and then the results of the calculations will appear in cells C1 and C2. I want to find a way to export the information from all aforementioned cells into a target worksheet once the information is 'submitted'.

    • User 1 opens the workbook, adds data to B1-B5 of worksheet 1, presses submit and the information is exported to row 2 of worksheet 2. The file is saved and closed.
    • User 2 opens the workbook, adds data to B1-B5 of worksheet 1, presses submit and the information is exported to row 3 of worksheet 2. The file is saved and closed.

    Essentially, worksheet 1 works as a portal to obtain the data and everything is saved on worksheet 2. I hope that is clear, sorry I can't share the file, as it contains some sensitive information.

    Regards,

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,084

    Re: How to use a Macro submit button to export results to another worksheet

    Assign this code to a button on your worksheet. It will also clear the range after it is copied to sheet 2 so that it is ready for new input for the next user.
    Sub CopyData()
        Range("B1:B5").Copy
        Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial Transpose:=True
        Range("B1:B5").ClearContents
    End Sub
    Last edited by Mumps1; 05-20-2013 at 11:26 AM.

+ 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