Hello!
I'm trying to create a pop-up window using VBA. I've been using a post by Trevor G and Lisa1, and I belive I've gotten quite ahead on this, but I can't conclude my window, as this is a bit more complex than the one on the mentioned post.
Here's what I have so far:
___________________________________________________________________________________
_______________________________________________________________________________________
_______________________________________________________________________________________
I Also have two modules:
MODULE 1:
MODULE 2:
An Anyone tell me where my mistakes are?
Thanks!!!!
Patrick
I'm trying to create a pop-up window using VBA. I've been using a post by Trevor G and Lisa1, and I belive I've gotten quite ahead on this, but I can't conclude my window, as this is a bit more complex than the one on the mentioned post.
Here's what I have so far:
Code:
Private Sub cmdOK_Click()
Sheets("Sheet2").Select
Range("A2").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Offset(0, 1).Value = Me.txtListBox1.Value
ActiveCell.Offset(0, 2).Value = Me.txtFrame1.Value
ActiveCell.Offset(0, 3).Value = Me.txtCheckBox1.Value
ActiveCell.Offset(0, 4).Value = Me.txtTextBox1.Value
ActiveCell.Offset(0, 5).Value = Me.txtTextBox2.Value
ActiveCell.Offset(0, 6).Value = Me.txtTextBox3.Value
ActiveCell.Offset(0, 7).Value = Me.txtTextBox4.Value
ActiveCell.Offset(0, 8).Value = Me.txtFrame2.Value
ActiveCell.Offset(0, 9).Value = Me.txtTextBox5.Value
ActiveCell.Offset(0, 10).Value = Me.txtTextBox8.Value
ActiveCell.Offset(0, 11).Value = Me.txtTextBox11.Value
ActiveCell.Offset(0, 12).Value = Me.txtTextBox12.Value
ActiveCell.Offset(0, 13).Value = Me.txtTextBox6.Value
ActiveCell.Offset(0, 14).Value = Me.txtTextBox7.Value
ActiveCell.Offset(0, 15).Value = Me.txtTextBox9.Value
ActiveCell.Offset(0, 16).Value = Me.txtTextBox10.Value
Me.Hide
End Sub
___________________________________________________________________________________
Code:
Private Sub UserForm_Initialize()
' Fill the list box
With ListBox1
.AddItem "PST"
.AddItem "PT"
.AddItem "AUTO"
.AddItem "GSU"
.AddItem "REAC"
End With
' Select the first kist item
ListBox1.ListIndex = 0
End Sub
_______________________________________________________________________________________
Code:
Private Sub CancelButton_Click()
Unload UserForm1
End Sub
_______________________________________________________________________________________
I Also have two modules:
MODULE 1:
Code:
Sub showForm1()
UserForm1.Show
End Sub
MODULE 2:
Code:
Sub ShowList()
UserForm1.Show
End Sub
An Anyone tell me where my mistakes are?
Thanks!!!!
Patrick
Last edited by a moderator: