dotchieJack
Member
Hoi everybody
I want to add this code under a command button in an excel userform
The code under this commandbutton is now
Can someone help pls
Thanks
I want to add this code under a command button in an excel userform
Code:
Range("H:H").numberformat="$ #,##0.00_-"
Code:
Private Sub CommandButton4_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = ActiveSheet
iRow = ws.Cells(Rows.Count, 3) _
.End(xlUp).Offset(1, 0).Row + 1
ws.Cells(iRow, 3).Value = Me.TextBox20.Value
ws.Cells(iRow, 3).Font.Bold = True
ws.Cells(iRow, 8).Value = Me.TextBox12.Value
ws.Cells(iRow, 8).Font.Bold = False
iRow = ws.Cells(Rows.Count, 3) _
.End(xlUp).Offset(1, 0).Row
ws.Cells(iRow, 3).Value = Me.TextBox30.Value
ws.Cells(iRow, 3).Font.Bold = True
ws.Cells(iRow, 8).Value = Me.TextBox29.Value
ws.Cells(iRow, 8).Font.Bold = False
iRow = ws.Cells(Rows.Count, 3) _
.End(xlUp).Offset(1, 0).Row
ws.Cells(iRow, 3).Value = Me.TextBox31.Value
ws.Cells(iRow, 3).Font.Bold = True
ws.Cells(iRow, 8).Value = Me.TextBox32.Value
ws.Cells(iRow, 8).Font.Bold = False
iRow = ws.Cells(Rows.Count, 3) _
.End(xlUp).Offset(1, 0).Row
ws.Cells(iRow, 3).Value = Me.TextBox21.Value
ws.Cells(iRow, 3).Font.Bold = True
ws.Cells(iRow, 8).Value = Me.TextBox22.Value
ws.Cells(iRow, 8).Font.Bold = False
iRow = ws.Cells(Rows.Count, 3) _
.End(xlUp).Offset(1, 0).Row
ws.Cells(iRow, 3).Value = Me.TextBox25.Value
ws.Cells(iRow, 3).Font.Bold = True
ws.Cells(iRow, 8).Value = Me.TextBox26.Value
ws.Cells(iRow, 8).Font.Bold = False
iRow = ws.Cells(Rows.Count, 3) _
.End(xlUp).Offset(1, 0).Row
ws.Cells(iRow, 3).Value = Me.TextBox28.Value
ws.Cells(iRow, 3).Font.Bold = True
ws.Cells(iRow, 8).Value = Me.TextBox27.Value
ws.Cells(iRow, 8).Font.Bold = False
iRow = ws.Cells(Rows.Count, 3) _
.End(xlUp).Offset(1, 0).Row + 1
ws.Cells(iRow, 3).Value = Me.TextBox23.Value
ws.Cells(iRow, 3).Font.Bold = True
ws.Cells(iRow, 8).Value = Me.TextBox24.Value
ws.Cells(iRow, 8).Font.Bold = False
ws.Cells(iRow, 8).Font.Underline = xlUnderlineStyleSingle
End Sub
Thanks