View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Michael J. Malinsky Michael J. Malinsky is offline
external usenet poster
 
Posts: 37
Default Adding tabstrip and runtime

The number of tabs depends on the number of rows in a particular range. The
number of rows could change which is the reason for my previous question.
It sounds like your suggestion is to create a tabstrip with, say, 100 tabs
then only make a certain number visible based on my range, right?


--
Michael J. Malinsky


"Richard Choate" wrote in message
...
Is it possible for you to create the complete tab strip in advance and

then
just change what is visible at runtime instead of building them at

runtime?
Excel/VBA is going to assign names to the tabs when you do that and it

won't
be all that clean the way you are doing it.
HTH
Richard Choate

"Michael J. Malinsky" wrote in message
...
I have the following code that adds a TabStrip and tabs at runtime. This

is
the basic form, since the number of tabs will be determined by data on a
worksheet. What I'm having trouble with is how to refer to the tabs later
in the code. In my example, I end up with TabStrip1 with 11 tabs
(.Value=0-10) named Tab1 through Tab11.

Private Sub UserForm_Initialize()

Set MyCtrl = UserForm1.Controls.Add("Forms.TabStrip.1", "TabStrip1")

For x = 2 To 10
Set MyNewTab = MyCtrl.Add("Tab" & x + 1, "Tab" & x + 1, x)
Next x


End Sub

When I try to refer to the TabStrip or the tabs, I get an Object Required
error. What would be the proper way to refer to these items after created
at runtime?

TIA

--
Michael J. Malinsky