+ Reply to Thread
Results 1 to 12 of 12

help with a submit button

  1. #1
    Registered User
    Join Date
    08-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    8

    help with a submit button

    Hi all

    Can someone please help me with a macro to make a submit button on sheet 1 take info form a row of cells, say a1,b1,c1,d1 and add it to a list on sheet 2
    then clear the info from sheet 1 ready for new input.
    when the button is pressed again it takes the new info from the same cells on sheet 1 and adds it to sheet 2 below the last line forming a list of info on sheet 2.

    hope that makes scene

    Im also very new to coding in excel so please explain how it works so i can modify it as needed.

    Many thanks for any help.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: help with a submit button

    Try:
    Please Login or Register  to view this content.
    Simple enough - it cuts range A1:D1 from Sheet1 and pastes to the next unused row in Sheet2.

    Change sheet names to suit - note the references are to worksheet codenames.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    08-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: help with a submit button

    Thanks for the fast reply i have added that code to a command button and entered info into a1 to d1 but when i hit the button nothing happens and the info in the cells stays there sheet 2 is still blank

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: help with a submit button

    What are your worksheet codenames?

  5. #5
    Registered User
    Join Date
    08-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: help with a submit button

    just working with a fresh work sheet to get it working then i will add it to my sheet so sheets are called the default names (sheet1,sheet2 ect)

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: help with a submit button

    OK. Attach your workbook then, let's see what's going on

  7. #7
    Registered User
    Join Date
    08-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: help with a submit button

    test sheet.xlsm

    ok think its attached

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: help with a submit button

    You need to put the code in the Button Click event. Your code looks like this:

    Please Login or Register  to view this content.

    It needs to look like this:
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: help with a submit button

    Got it many thanks
    now to make this start inputing to a set row ie list starts at row a3 down do i just add a row number after the Sheet2 bit?

  10. #10
    Registered User
    Join Date
    08-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: help with a submit button

    Ok this works but...
    Is there a way to have this cut the row without removing and formulas as the info is gathered from various cells over sheet 1 so i have set a row on sheet 2 to put all the data in to order in a line e.g
    on sheet 2 A34=Sheet1 B2 B34=Sheet1 J6 C34=Sheet!1 C5 ect
    I have set the code to cut Sheet!2 A34:F34 and put it onto sheet!3 on the next free line
    Just need it to leave the = reference in place ready for the next input of data.
    Thanks.

  11. #11
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: help with a submit button

    Changing it to something like:
    Please Login or Register  to view this content.
    This copies, rather than cutting; and pastes values.

    Sorry, I didn't follow your "sheet 2 A34=Sheet1 B2 B34=Sheet1 J6 C34=Sheet!1 C5 ect" stuff; I'm sure you figure out how to combine what I've shown you with the exact references you need.

  12. #12
    Registered User
    Join Date
    08-11-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: help with a submit button

    perfect your a star thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 02-05-2012, 09:31 PM
  2. Submit Button
    By michellecairns in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-25-2011, 10:13 AM
  3. Create a Submit button save filename as A1, submit email unc path, etc.
    By briant97 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-30-2009, 09:52 AM
  4. can I add a submit button?
    By fry in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-02-2007, 06:35 PM
  5. Submit Button
    By edwardpestian in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-27-2006, 03:30 PM

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