+ Reply to Thread
Results 1 to 6 of 6

ActiveX Command Button Code to enter a cell values from a series of cells to another

  1. #1
    Registered User
    Join Date
    04-26-2014
    Location
    Utah
    MS-Off Ver
    Excel 2311 Build 16.0.17029.20028 64 bit
    Posts
    52

    ActiveX Command Button Code to enter a cell values from a series of cells to another

    I want the button to insert values from other cells. so when it is clicked, the values in cells F82-F86 are entered in cells E19 - E23. Is this possible?

    I know how to make the ActiveX Command Button, but I don't know how to write the code. What is the code for this action?

    Rob

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: ActiveX Command Button Code to enter a cell values from a series of cells to another

    Assuming your command button is called CommandButton1:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-26-2014
    Location
    Utah
    MS-Off Ver
    Excel 2311 Build 16.0.17029.20028 64 bit
    Posts
    52

    Re: ActiveX Command Button Code to enter a cell values from a series of cells to another

    Quote Originally Posted by stnkynts View Post
    Assuming your command button is called CommandButton1:

    Please Login or Register  to view this content.
    Perfect; thank you!

    It now seems that I like this feature of Excel and will use it more. Where can I learn the principles of code so I don't have to keep asking in this forum? Of course this forum is the easiest place for me to find a specific soultion, but I don't want to become a pest here.

    My next task is to make a radio button so when selected the value from one cell is repeated in another cell. I tried to use a format similar to the one for a range but didn't get it right; it worked but it was not right

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: ActiveX Command Button Code to enter a cell values from a series of cells to another

    Here is for your option button. Maybe this code will make things clearer:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-26-2014
    Location
    Utah
    MS-Off Ver
    Excel 2311 Build 16.0.17029.20028 64 bit
    Posts
    52

    Re: ActiveX Command Button Code to enter a cell values from a series of cells to another

    I was not able to make this code work. no doubt this is due to my lack of the concepts involved. This is the code I copied and pasted:

    Dim SourceCell As Range, DestinationCell As Range

    Set SourceCell = Range("A1")
    Set DestinationCell = Range("B1")

    If OptionButton1.Value = True Then
    DestinationCell.Value = SourceCell.Value
    End If


    The radio button is so small that I am now considering a different approach to this;

    A toggle button.

    I'm guessing it does not matter where the toggle button is placed. Since the worksheet is complete, I prefer to not redesign it. So, my ides is this: When the toggle is pushed, the value of the cell under the toggle is repeated in a different cell. In my design this number causes the cells in the row where the number is to fill with data.

    Here is my idea: When the toggle is clicked, it shows that it is recessed. The value from Cell F82 is repeated in Cell F19.

    I used this code: Range("F82").Value = Range("F19").Value

    Here is what happens when the toggle is pressed: F82 blanks, F19 remains blank. I want the value in F82 to remain and the same value in F19.

    Thank you

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: ActiveX Command Button Code to enter a cell values from a series of cells to another

    Submit your workbook.

+ 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: 2
    Last Post: 07-13-2013, 01:10 AM
  2. Excel VBA Code for Command Button to Solve based on Cell Values
    By Ancientfall in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2012, 08:33 PM
  3. Add a clear values code to command button
    By titantough in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-14-2011, 01:15 AM
  4. Command button code that fills two combo box values and a toggle in cell
    By vdongen in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-03-2010, 12:03 AM
  5. ActiveX command button
    By Dr.Schwartz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2005, 04:05 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