johnreid7477
New Member
- Joined
- May 28, 2013
- Messages
- 29
Hi All,
Need help for my userform example :
=============================================================================
USERFORM VBA
=============================================================================
Invoice : 0001/SM/06/13
Date : 01 June 2013
Description :
<tbody>
</tbody>
==============================================================================
My question 1 : if input 4 item in Description, and for invoice & date will be auto copy same 4 in rows.
My question 2 : how i can input next item, type, rate in rows .... please help what's vba code i must changes or add.
If code working final result database like this :
==============================================================================
DATABASE SHEET
==============================================================================
<tbody>
</tbody>
===============================================================================
my bad code :
Thanks - John
Need help for my userform example :
=============================================================================
USERFORM VBA
=============================================================================
Invoice : 0001/SM/06/13
Date : 01 June 2013
Description :
ITEM : | TYPE : | PRICE |
ITEM1 | HOT | $ 1 |
ITEM2 | HOT | $ 1 |
ITEM3 | HOT | $ 1 |
ITEM4 | SPECIAL | $ 5 |
<tbody>
</tbody>
==============================================================================
My question 1 : if input 4 item in Description, and for invoice & date will be auto copy same 4 in rows.
My question 2 : how i can input next item, type, rate in rows .... please help what's vba code i must changes or add.
If code working final result database like this :
==============================================================================
DATABASE SHEET
==============================================================================
B | C | L | K | M | |
1 | Invoice | Date | Item | Type | Rate |
2 | 0001/SM/06/13 | 01 June 2013 | ITEM1 | HOT | $ 1 |
3 | 0001/SM/06/13 | 01 June 2013 | ITEM2 | HOT | $ 1 |
4 | 0001/SM/06/13 | 01 June 2013 | ITEM3 | HOT | $ 1 |
5 | 0001/SM/06/13 | 01 June 2013 | ITEM4 | SPECIAL | $ 5 |
<tbody>
</tbody>
===============================================================================
my bad code :
Code:
Private Sub buttonnew_Click()
Dim RowCount As Long
Dim benefits, total As Single
'copy the data to the database
RowCount = Worksheets("Database").Range("B1").CurrentRegion.Rows.Count
With Worksheets("Database").Range("B1")
.Offset(RowCount, 0) = Me.invoice.Value
.Offset(RowCount, 1) = Me.date.Value
.Offset(RowCount, 11) = Me.item1.Value
.Offset(RowCount, 10) = Me.type.Value
.Offset(RowCount, 12) = Me.rate.Value
End With
End Sub
Thanks - John