Userform auto copy invoice & date if item fills in rows

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 :
ITEM :TYPE :PRICE
ITEM1HOT$ 1
ITEM2HOT$ 1
ITEM3HOT$ 1
ITEM4SPECIAL$ 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
==============================================================================
BCLKM
1Invoice
Date
Item
Type
Rate
20001/SM/06/1301 June 2013ITEM1HOT$ 1
30001/SM/06/1301 June 2013ITEM2HOT$ 1
40001/SM/06/1301 June 2013ITEM3HOT$ 1
50001/SM/06/1301 June 2013ITEM4SPECIAL$ 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
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,221,607
Messages
6,160,792
Members
451,671
Latest member
kkeller10

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top