asyamonique
Well-known Member
- Joined
- Jan 29, 2008
- Messages
- 1,286
- Office Version
- 2013
- Platform
- Windows
Good Day,
With below code TextBox5 data is the amount of the tickets supposed to be given to the visitors for a ruffle.
I will be additional code to print those tickets base on TextBox5 data ("E2") which base on below target worksheet cells.
The frame I've prepared base on below cells A to D
Many Thanks.
Worksheet Name: PRINT
A2: Visitors ID#
B2: Name & Surname
C2: Date
D2: Day
E2: Total tickets amount to be printed!
With below code TextBox5 data is the amount of the tickets supposed to be given to the visitors for a ruffle.
I will be additional code to print those tickets base on TextBox5 data ("E2") which base on below target worksheet cells.
The frame I've prepared base on below cells A to D
Many Thanks.
Worksheet Name: PRINT
A2: Visitors ID#
B2: Name & Surname
C2: Date
D2: Day
E2: Total tickets amount to be printed!
VBA Code:
Private Sub CommandButton2_Click()
On Error Resume Next
Dim asy As Long
With Sheets("All Data")
If .Cells(1, 1).Value = "" Then
asy = 1
Else
asy = .Cells(Rows.Count, 1).End(xlUp).Row + 1
End If
.Cells(asy, 1) = TextBox1.Value
.Cells(asy, 2) = TextBox2.Value
.Cells(asy, 3) = TextBox3.Value
.Cells(asy, 4) = TextBox4.Value
.Cells(asy, 5) = TextBox5.Value
End With
End Sub