+ Reply to Thread
Results 1 to 6 of 6

Troubleshoot Excel-vba Code

  1. #1
    Registered User
    Join Date
    01-09-2007
    Posts
    7

    Troubleshoot Excel-vba Code

    WHEN I WRITE THE FOLLOWING CODE, IT SHOWS ME THAT EXCEL HAS ENCOUNTERED A PROBLEM & IT CLOSES THE FILE SHOWING SEND ERROR REPORT OR DONT SEND. PLEASE HELP ME OUT OF THIS PROBLEM


    Private Sub TempCombo_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    'Hide combo box and move to next cell on Enter and Tab
    Select Case KeyCode
    'FOR ENTER
    Case 13
    ActiveCell = TEMPCOMBO.Text
    ActiveCell.Offset(1, 0).Activate
    Case Else
    'do nothing
    End Select
    ERRORHANDLER:
    END SUB

  2. #2
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    In a standard module you must initialize the contents of the combo box:
    Sub Initialize()
    UserForm1.TempCombo.AddItem "Here", 0
    UserForm1.TempCombo.ListIndex = 0
    UserForm1.Show
    End Sub
    Best regards,

    Ray

  3. #3
    Registered User
    Join Date
    01-09-2007
    Posts
    7
    Quote Originally Posted by raypayette
    In a standard module you must initialize the contents of the combo box:
    Sub Initialize()
    UserForm1.TempCombo.AddItem "Here", 0
    UserForm1.TempCombo.ListIndex = 0
    UserForm1.Show
    End Sub
    thanks 4 ur reply

    but mine is not userform,it is only combox control on the sheet which gets activated when it meets some criteria. it is combobox control object.

    thanks in advance
    by the way how can i add u 2 my messenger list. do u have yahoo or hotmail account

  4. #4
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    Your code is applicable only for a userform combobox. A worksheet "combo box" would have this type of id:
    ActiveSheet.Shapes("Drop Down 1").Select

  5. #5
    Registered User
    Join Date
    01-09-2007
    Posts
    7

    sending my file

    Quote Originally Posted by raypayette
    Your code is applicable only for a userform combobox. A worksheet "combo box" would have this type of id:
    ActiveSheet.Shapes("Drop Down 1").Select
    i m sending my file, u just have a look & revert

    regards

  6. #6
    Registered User
    Join Date
    01-09-2007
    Posts
    7
    Quote Originally Posted by dhavanchopra
    i m sending my file, u just have a look & revert

    regards
    ACTUALLY I WANT THAT WHEN I MOVE TO ENTERING THE 'TO' COLUMN IN CELL B3, THE COMBO BOX SHOULD APPEAR WITH DROP DOWN BOX OPEN & NOT AS IT IS NOW.

    MOREOVER WHEN I SELECT ONE ITEM FROM TO COMBO BOX & PRESS ENTER THEN IT GIVES ME THE EXCEL ENCOUNTER ERROR.

    I NEED THAT I CAN EXIT COMBO BOX BY PRESSING ENTER.

    REGARDS

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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