+ Reply to Thread
Results 1 to 10 of 10

sending data using command button

  1. #1
    Registered User
    Join Date
    11-19-2019
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    12

    sending data using command button

    hello, im trying to use command button that will send data to a specific cell (c17 in this case) in another workbook sheet.
    so far ive used this command and it worked great:

    Please Login or Register  to view this content.
    what i wanna do next is to define that everytime the button is clicked the cell that got the data goes 2 cells further.
    what i mean is that if the data went to Range.("C17").value then next time ill click on it the data will go to Range.("C19")
    nothing comes up to my mind, help please

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,737

    Re: sending data using command button

    Keep this var somewhere in cell.
    For ex. in any sheet in cell A1 you will put 1.
    Then in your macro above:

    Please Login or Register  to view this content.
    Not tested but should works.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Valued Forum Contributor saravnepali's Avatar
    Join Date
    01-14-2019
    Location
    Sydney Australia
    MS-Off Ver
    2010
    Posts
    447

    Re: sending data using command button

    If the cell column C doesn't have other data we can use the last row option to do it

    Please Login or Register  to view this content.
    If you think someone helped you, click on the "* Add Reputation" as a way to say thank you.

    If your problem is solved, go to Thread Tools and select Mark This Thread Solved

  4. #4
    Registered User
    Join Date
    11-19-2019
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    12

    Re: sending data using command button

    Quote Originally Posted by KOKOSEK View Post
    Keep this var somewhere in cell.
    For ex. in any sheet in cell A1 you will put 1.
    Then in your macro above:

    Please Login or Register  to view this content.
    Not tested but should works.
    first of all thank you very much for help
    second, unfortunately i couldnt understand the code.

    at wherenow definition in "A1" cell what cell should i put there? the one's i need to transfer or the ones that should get the data?

    and on the line
    Please Login or Register  to view this content.
    it seems like maybe you didnt understand what im trying to do?
    im not trying to add 2 to the value for each click, im trying to move 2 cells for each click.

    as if that my list value is "Window"
    first click - the value in C17 will be "Window"
    second click - the value in C19 will be "Window"

  5. #5
    Registered User
    Join Date
    11-19-2019
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    12

    Re: sending data using command button

    Quote Originally Posted by saravnepali View Post
    If the cell column C doesn't have other data we can use the last row option to do it

    Please Login or Register  to view this content.
    it didnt work bro, what i need to happen is that it will goes to cells down every click (as if its a1 to a3)

    your code made it goes like 2-3 cells left and 1 cell down (as if from a1 to c3)

  6. #6
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,737

    Re: sending data using command button

    Quote Originally Posted by omri20 View Post
    as if that my list value is "Window"
    first click - the value in C17 will be "Window"
    second click - the value in C19 will be "Window"
    Check attached file. Choose number and use button, choose number and use button.
    Choosen number will appear in col C (each 2 rows lower than prev).
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-19-2019
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    12

    Re: sending data using command button

    Quote Originally Posted by KOKOSEK View Post
    Check attached file. Choose number and use button, choose number and use button.
    Choosen number will appear in col C (each 2 rows lower than prev).
    problem is i need the value to go through workbooks and not through sheets bro

  8. #8
    Registered User
    Join Date
    11-19-2019
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    12

    Re: sending data using command button

    Quote Originally Posted by omri20 View Post
    problem is i need the value to go through workbooks and not through sheets bro
    and i cant understand the code dont understand how its not a _click() type Sub and what is this "myvarsheet" cause i dont see any other sheet than sheet1
    could u explain me what you did there?

  9. #9
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,737

    Re: sending data using command button

    MyVarSheet is hidden. You want to keep only counter there so user does not have to have access to it.
    The same engine with another workbook not sheet bro...
    You have to open desired workbook but the rest stays the same.

  10. #10
    Registered User
    Join Date
    11-19-2019
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    12

    Re: sending data using command button

    Quote Originally Posted by KOKOSEK View Post
    MyVarSheet is hidden. You want to keep only counter there so user does not have to have access to it.
    The same engine with another workbook not sheet bro...
    You have to open desired workbook but the rest stays the same.
    Yes but could you explain me why a hidden workbook needed for that? why do i need it? if i dont take any data from it how does it help me to transfer the value to an another workbook?
    I need to understand the actual code meaning, Thank you very much!

+ 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. [SOLVED] Sending data to another workbook with command button
    By omri20 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2019, 08:17 AM
  2. Replies: 2
    Last Post: 02-02-2016, 10:27 PM
  3. Insert Command Button that will Activate Command Button on a Different Sheet
    By realvirtuality1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2016, 02:11 PM
  4. VBA code to create command button. Print all sheets then delete command button.
    By Declamatory in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-15-2015, 05:18 PM
  5. Need help with sending data from one sheet to another with a click of a button.
    By Piu Chatterjee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-27-2013, 06:44 AM
  6. Replies: 1
    Last Post: 09-17-2007, 09:57 PM
  7. Replies: 0
    Last Post: 11-03-2005, 11:00 AM

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