Toolbars - Follow-up query for Tim Francis-Wright


Posted by JAF on January 17, 2001 6:35 AM

Tim

You posted a reply to my query about hiding and showing toolbars (8140.html) but I can't get it to work.

When I run the ClearTBs code, I get run time error 1004 and the following line of code is highlighted:
CurWS.Range("TBListRange").Offset(j).Value = vTBID

I've tried to work out what the code is doing, but it's a little more advanced than my level of VBA knowledge can cope with!

Is it something that I'm doing wrong (and if so, any suggestions as to what it might be?!) or is there a typo in the code that's causing a problem?

Hope you can help.

JAF



Posted by Tim Francis-Wright on January 17, 2001 6:48 AM


Mea culpa! I should have tried out the code
before posting. Here are the last five lines
of the first sub:

CurWS.Range("TBListRange").Offset(j).Value = vTBID
End If
Next
Application.Calculation = xlCalculationAutomatic
End Sub

1. You need to define a range called TBListRange
on Sheet1, starting on A2. (You can change the
parameters as you like. There's surely a more
robust way to do this.)

2. You also need to insert the following line
of code before the End If statement :-

List(i).Visible = False

NOW it works.

Good luck!