Excel Sheet - Toggle Button to send value from Combo Drop Down to a cell


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Excel Sheet - Toggle Button to send value from Combo Drop Down to a cell

  1. #1
    Join Date
    Sep 2008
    Posts
    11

    Excel Sheet - Toggle Button to send value from Combo Drop Down to a cell

    I am designing a spreadsheet and I want to know how to make a toggle button send the current selection from a Combo Drop Down box to a specific cell then hide the combo box.. And when the toggle button is clicked again i want the cell to become blank and show the combo drop down box again.

    please help!

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    How about something like
    Code:
    Private Sub ComboBox1_Click()
    Sheets("Sheet1").Range("A1") = ComboBox1.Text
    End Sub
    Code:
    Private Sub CommandButton1_Click()
    Sheets("Sheet1").Range("A1") = vbNullString
    End Sub
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Sep 2008
    Posts
    11
    Hack you're always so fast to respond! I love it!

    i'll try the code when i get back from my break,

    Thanks

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Hiding the combo box would be as easy as toggling its visible property from True To False

    The one thing I'm not sure of is its placement. Is this going to be on a specific spot, or is it supposed to keep moving around some how?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Replies: 8
    Last Post: 01-09-2003, 10:42 PM
  2. Need Help with VBA for Excel
    By Bob in forum VB Classic
    Replies: 0
    Last Post: 03-14-2002, 03:27 PM
  3. Populating a 'button' column in DataGrid
    By moben in forum VB Classic
    Replies: 6
    Last Post: 01-16-2002, 04:05 AM
  4. Replies: 4
    Last Post: 11-10-2000, 02:02 AM
  5. Replies: 0
    Last Post: 08-11-2000, 09:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center