• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

Opening a workbook with list box

In the attached workbook it opens directly to the first tab "Menu". In that worksheet is a list box labeled lstCaregory. I would like to always have the first item in the list box be the default when the workbook opens.
Frank Freese
Frank Freese
  • 3
1 Solution
Martin LissOlder than dirtCommented:
In Workbook_Open put
lstCategory.ListIndex = 0
Martin LissOlder than dirtCommented:
You can integrate it like this.

Private Sub Workbook_Open()

Dim intIndex As Integer

With Worksheets("Menu")
    For intIndex = 10 To .UsedRange.Rows.Count
        .Cells(intIndex, 1).Value = ""
    .lstCategory.ListIndex = 0 ' New line
End With
ActiveWindow.ScrollRow = 10
Sheets("Menu").lblDescription.Caption = ""
ActiveWindow.DisplayWorkbookTabs = True

End Sub

Open in new window

Frank FreeseAuthor Commented:
That's what I kind of thought
Thanks again
Martin LissOlder than dirtCommented:
Your welcome.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now