List Box Macro problem
Posted by Keith on June 22, 2000 2:30 AM
Urgent help required.
I've got a big problem and I can't sort it out.
I have a list box that contains the list of all sheet names in my workbook. When you click on the name it escorts you to that particular sheet.
HOWEVER I have a macro that inserts and deletes sheets then automatically alphabetically sorts the sheets and then an updated list should appear in the list box.
The macro falls over and highlights "SheetName = Range("k44").Text" With an error message "Unable to get the Text property of the range class".
k44 refers to a concatenated cell in j44.
Is there an obvious problem that I can't see?
My code for the list box is below:
Private Sub ListBox1_Click()
Dim SheetName As String
'In this case assume Sheet called "1 Print"
Application.ScreenUpdating = False
SheetName = Range("k44").Text
Application.DisplayAlerts = False
On Error Resume Next
ActiveWindow.DisplayWorkbookTabs = True