Hi Excelfox,
My first thread sorry if make mistake or confusing.
My question 1 : If input 4 "item" (4 cells) in Description automatic "invoice & date" will be auto copy / create same 4 in cells.
My question 2 : How input next item, type, rate in next cells (because my first VBA only single cells), i don't understand to combine ...
================================================== ==
Example Userform VBA
================================================== ==
================================================== ==
Invoice : 0001/SM/06/13 Date : 01 June 2013 Description : Item Type Rate ITEM1 HOT $ 1 ITEM2 HOT $ 1 ITEM3 HOT $ 1 ITEM4 SPECIAL $ 5
================================================== ==
Example Result code if working
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
My single cell code. I'm not input (item2,item3,item4, type2,type3,typ4, rate2,rate,3,rate4) because confusing must use cells ..or Ws.... and ...
Thanks - JohnCode: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
Note :
1. My Example and attachment (original file) it's different looking.
2. Other post but no answer mrexcel




Reply With Quote
Bookmarks