Hey guys, all good?
I'm with a kind of a problem by doing a dynamic userform and i'm glad to have the help of you.
I'm working on a excel sheet to do a project management tool, as i dont have any access to MS Project in my company and as a part of this tool i was planning to do a resource management controller for the tasks i have on my project and i thought on do that with an userform that will have a listbox of all resources that will be uploaded by the project management team, but the thing is i just cant add itens to the new listboxs that i've created, could you help me? I'll post the code here and i'd glad if you could help to manage that.
I just want to know how i cant reference this new listboxes that i'm creating with the VBA code, because i'll have to add itens to that listbox later. Could you help me?
Thanks a lot,
glawberc
I'm with a kind of a problem by doing a dynamic userform and i'm glad to have the help of you.
I'm working on a excel sheet to do a project management tool, as i dont have any access to MS Project in my company and as a part of this tool i was planning to do a resource management controller for the tasks i have on my project and i thought on do that with an userform that will have a listbox of all resources that will be uploaded by the project management team, but the thing is i just cant add itens to the new listboxs that i've created, could you help me? I'll post the code here and i'd glad if you could help to manage that.
VBA Code:
Private Sub UserForm_Activate()
Dim l As Double, r As Double, x As Integer, i As Integer
Dim ctl As Control
'I have utilized this method for adding the pages just one time'
If MultiPage1.Pages.Count < 2 Then
'This count the macro tasks that is listened as integer values on a normal sheet'
For i = 14 To [Tabela8].Rows.Count
If VarType(Range("A" & i).Value) = vbDouble Then
ComboBox1.AddItem Range("B" & i).Value
End If
Next i
'Here i just add the número of pages equivalent to the macro task that i have counted'
For x = 1 To ComboBox1.ListCount
MultiPage1.Pages.Add
Dim MyFrame As Frame
Set MyFrame = MultiPage1.Pages(x).Add("Forms.Frame.1", "MyFrame", x)
'I also add the frames inside the pages'
With MyFrame
.Name = "Frame" & x + 1
.Top = 6
.Left = 6
.Height = 312
.Width = 678
Dim LTBox
Set LTBox = .Controls.Add("Forms.ListBox.1")
'and the listbox'
With LTBox
.Name = "ListBox" & x + 1
.Top = 40
End With
End With
Next
End If
End Sub
I just want to know how i cant reference this new listboxes that i'm creating with the VBA code, because i'll have to add itens to that listbox later. Could you help me?
Thanks a lot,
glawberc