ListBoxEnsureVisible – Ensure that a ListBox element is visible

ListBoxEnsureVisible – Ensure that a ListBox element is visible

' ensure that a listbox item is visible' if the second argument is omitted, the index of current item is used'' NOTE: uses the ListBoxVisibleItems functionSub ListBoxEnsureVisible(lst As ListBox, Optional ByVal itemIndex As Long = -1)    Dim visibleCount As Long        ' provide a default for the 2nd argument    If itemIndex < 0 Then itemIndex = lst.ListIndex        ' get the number of visible items    visibleCount = ListBoxVisibleItems(lst)        If itemIndex < lst.TopIndex Then        ' scroll up        lst.TopIndex = itemIndex    ElseIf itemIndex >= lst.TopIndex + visibleCount Then        ' scroll down        lst.TopIndex = itemIndex - visibleCount + 1    End If    End Sub

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular