Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Jan 2002
    Houston, Texas, USA
    Thanked 0 Times in 0 Posts

    Excel Combo Box Macro

    I have Excel 2003. I need to create a field of categories so that the user can choose a category for each record. I created an option box for the cell which needs to be copied to every cell in the column. If a new row is inserted, the option box would have to be inserted for that row, as well. My thought was to create a macro with a shortcut key so that the user could input the shortcut key and insert the box automatically. I did all that, but, when I ran the macro, it keeps going back to the cell I started on and copies the darn box in that cell instead of the cell the insertion point is on. Here's a copy of the code:

    ' Keyboard Shortcut: Ctrl+z
    ActiveSheet.DropDowns.Add(359.25, 30.75, 77.25, 15.75).Select
    With Selection
    .ListFillRange = "$L$2:$L$10"
    .LinkedCell = ""
    .DropDownLines = 9
    .Display3DShading = False
    End With
    End Sub

    I sure will be grateful for any help I can get on this. It doesn't have to be a combo box. It just needs to give the user the choice of categories to insert.

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Manning, South Carolina
    Thanked 1,455 Times in 1,324 Posts

    You can use data validation to accomplish this task very easily.
    Attached Files Attached Files
    Last edited by RetiredGeek; 2012-12-05 at 20:26.
    May the Forces of good computing be with you!


    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts