Professional Documents
Culture Documents
Name FrmGeneral
1 Userform
Caption General Information
Name Page1
Caption Personal Information
1 Multipage
Name Page2
Caption My Favorite Painting
Name Label1
Caption Name
2 Label Name Label2
Caption Age
Name TxtName
2 Textbox
Name TxtAge
Name Frame1
1 Frame
Caption Gender
Name OptionButton1
Option Caption Male
2
Button Name OptionButton2
Caption Female
Name CmdOK
1 Commandbutton
Caption OK
Coding
Option Explicit
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 1).Value = TextBox1.Value
Cells(emptyRow, 2).Value = TextBox2.Value
'Close Userform
Unload Me
End Sub
If ListBox1.ListIndex = 0 Then
Image1.Picture = LoadPicture("C:\test\Mountains.jpg")
End If
If ListBox1.ListIndex = 1 Then
Image1.Picture = LoadPicture("C:\test\Sunset.jpg")
End If
If ListBox1.ListIndex = 2 Then
Image1.Picture = LoadPicture("C:\test\Beach.jpg")
End If
If ListBox1.ListIndex = 3 Then
Image1.Picture = LoadPicture("C:\test\Winter.jpg")
End If
End Sub
Private Sub UserForm_Initialize()
With ListBox1
.AddItem "Mountains"
.AddItem "Sunset"
.AddItem "Beach"
.AddItem "Winter"
End With
End Sub
MyList
=OFFSET(Example!$A$1;0;0;COUNTA(Example!$A:$A))
End Sub
Sheet
End Sub