+ Reply to Thread
Results 1 to 15 of 15

Macro Bombs Excel 2000

Hybrid View

  1. #1
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro Bombs Excel 2000

    Hi Leith.

    I know that line of code appears to be incorrect. Please understand, I have rewritten this post several times because, apparently, your servers were (are) having a problem. Finally, the last time, I copied the text of the post to notepad so I could simply paste when I was able to finally upload the post.

    That line of code got truncated into two lines as follows:

    .ListFillRange = "Categories!" + Sheets
    
    ("Categories").Range(str).Address
    If you delete the line break or whatever it is and make the code read

    .ListFillRange = "Categories!" + Sheets("Categories").Range(str).Address

    I think it will work for you. Let me know if this doesn't work for you and I will repost the code.
    I should add, the macro bombs when you have selected an item in column F, Category then hit the tab key. I sure hope you can figure this out. It's been driving me nuts.

    Thanks, John
    Last edited by jaslake; 06-01-2009 at 06:40 PM. Reason: Add additional Information

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro Bombs Excel 2000

    I'm reposting this code. My last post was made from a copy/paste from notepad. I had tried to post for three days and had server problems. This code is directly from the project.

    Private Sub TempCombo_KeyDown(ByVal _
                                  KeyCode As MSForms.ReturnInteger, _
                                  ByVal Shift As Integer)
        Dim cboTemp As OLEObject
        Set ws = ActiveSheet
        Set cboTemp = ws.OLEObjects("TempCombo")
    
        'Hide combo box and move to next cell on Enter and Tab
        Select Case KeyCode
        Case 9
            cboTemp.Visible = False
            ActiveCell.Offset(0, 1).Activate
        Case 13
            cboTemp.Visible = False
            ActiveCell.Offset(0, 1).Activate
        Case Else
            'do nothing
        End Select
    
    End Sub
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        Dim str As String
        Dim cboTemp As OLEObject
        Dim ws As Worksheet
        Set ws = ActiveSheet
        On Error GoTo errHandler1
    
        If Not Intersect(Target, Range("I12:I2024")) Is Nothing Then
            If Target.Cells.Offset(0, -1).Value <> "" Then
                ActiveCell.Offset(1, -7).Select
            Else: GoTo exitHandler
            End If
        End If
        If Intersect(Target, Range("F12:F2024")) Is Nothing Then GoTo exitHandler
        Set cboTemp = ws.OLEObjects("TempCombo")
        On Error Resume Next
        If cboTemp.Visible = True Then
            With cboTemp
                .Top = 10
                .Left = 10
                .ListFillRange = ""
                .LinkedCell = ""
                .Visible = False
                .Value = ""
            End With
        End If
    
        On Error GoTo errHandler1
        If Target.Validation.Type = 3 Then
            Application.EnableEvents = False
            str = Target.Validation.Formula1
            str = Right(str, Len(str) - 1)
            With cboTemp
                .Visible = True
                .Left = Target.Left
                .Top = Target.Top
                .Width = Target.Width + 15
                .Height = Target.Height + 5
                .ListFillRange = "Categories!" + Sheets("Categories").Range(str).Address
                .LinkedCell = Target.Address
            End With
            cboTemp.Activate
        End If
    
    exitHandler:
        Application.EnableEvents = True
        Application.ScreenUpdating = True
        ActiveSheet.Protect
        Exit Sub
    errHandler1:
        Resume exitHandler
    
    End Sub
    The rest of my original post still applies. The macro bombs when you have selected an item in worksheet "Check Register", column F, Category then hit the tab key. I sure hope you can figure this out. It's been driving me nuts.
    Hopefully you can help.

    Thanks, John

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro Bombs Excel 2000

    Hello John,

    You were right about the server problems. Everything should be back to normal according to forum's owner. I have been occupied about all day with other things and just back to look at the posts. If you could post the workbook, it would make it faster to troubleshoot the trouble the problem. I have Excel 2000 and can run it as is.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro Bombs Excel 2000

    I thought I had posted the workbook. In the event not, I am uploading it again.

    Thanks Leith.

    John
    Attached Files Attached Files

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro Bombs Excel 2000

    Hello John,

    This time there shouldn't be any server related snafus with the workbook. I rather be sure the only problems with the workbook are the original ones.

    Thanks,
    Leith Ross

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro Bombs Excel 2000

    Hello John,

    It runs using Excel 2000, but the combo box remains visible after clicking on another cell. I made several entries in column "I" and "J" and it didn't error.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro Bombs Excel 2000

    Hello John,

    I get the same behaviour in Excel 2003. The text box remains visible, and Excel doesn't crash.

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro Bombs Excel 2000

    Leith...make an entry in column F then TAB out of it to column G. This is where things go south on me.

    Does your system duplicate that? If not, what are you running for an operating system? I've tried this on two different computers today, both running Windows 2000 and Excel 2000 with the same result (Excel shuts down).

    Please look at the code for Check Register to make certain I've not commented out
    cboTemp.Visible = False
    . If I have, please remove the ' and try to rerun.


    If you can't duplicate the problem, I'm not sure where to go next.

    Thanks, John

+ 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