Combo Box Problem


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Combo Box Problem

  1. #1
    Join Date
    Dec 2012
    Posts
    1

    Combo Box Problem

    I am having problems with a script that I put into Excel 2007 for a combo box that hides and unhides ranges based upon the selection of the combo box. Works 7 out 10 times. When it doesn't work, it put Excel into some kind of loop that requires that I shut it down and restart. The "VBA reset" button doesn't do anything. Once I restart, the script works again. What am I doing wrong?

    Code:
    Private Sub ComboBox1_Change() 
         
        Worksheets("Plan Sheet").Range("c7").Select 
        Columns("D:UQ").Select 
        Selection.EntireColumn.Hidden = True 
         
        Range(ComboBox1.Value).Select 
        Selection.EntireColumn.Hidden = False 
         
        Worksheets("Plan Sheet").Range("c7").Activate 
        Selection.End(xlToRight).Select 
         
    End Sub

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Welcome to DevX

    Walk me through this....

    1. You open the spreadsheet
    2. You select something from the combobox
    3. The code runs successfullly
    4. ????? - what do you do next?
    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. Combo Box Problem Please help
    By Steve_8679 in forum VB Classic
    Replies: 1
    Last Post: 05-20-2004, 02:25 AM
  2. Combo Box Problem
    By RealGuru in forum .NET
    Replies: 6
    Last Post: 09-18-2002, 01:23 AM
  3. Combo Box problem
    By Darryl Ray in forum VB Classic
    Replies: 3
    Last Post: 02-17-2001, 11:02 AM
  4. Re: Combo Problem (Thanks)
    By KEVIN in forum VB Classic
    Replies: 0
    Last Post: 10-17-2000, 11:39 AM
  5. Combo Problem
    By Kevin in forum VB Classic
    Replies: 1
    Last Post: 10-17-2000, 11:06 AM

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