Good morning from a struggekling newbie.
In a effort to to control my timber stock I created a user form with 1 text boxes for Date, Supplier and then 7 lines of text boxes, size, lenght, quantity, linear Mt and cost per meter. This data is written to cells G1-G4 with a click botton. All stock is kept in a linear mt format as all timber is not supplied in the same lenghts. With this code
I am able to write the first line in the user form to the "Main Stock Sheet". How do I create a loop to cycle through the rest of the user form. All the lines in the user form may not always contain data. I would like to write only the lines with data. The data should be written to the first open cell in the work sheet.
Since the smoke is all ready coming out of my ears
There is a delivery cost that need to be divided up and added to the total linear meter. So my last line of code need to change somehow.
Gentelmen and ladies, you are heroes
Rgeards Herco
In a effort to to control my timber stock I created a user form with 1 text boxes for Date, Supplier and then 7 lines of text boxes, size, lenght, quantity, linear Mt and cost per meter. This data is written to cells G1-G4 with a click botton. All stock is kept in a linear mt format as all timber is not supplied in the same lenghts. With this code
Code:
Private Sub Import_Click()
Dim ws As Worksheet
Set ws = Worksheets("Main Stock Sheet")
ws.Range("A4") = InPutDate
ws.Range("B4") = ComBoxVendor
ws.Range("C4") = ComboBox1.Value
ws.Range("D4") = Lnght1.Value
ws.Range("E4") = Qty1.Value
ws.Range("F4") = Lnght1.Value * Qty1.Value
ws.Range("G4") = ((Lnght1.Value * Qty1.Value) / TransCost.Value) + (Prc1.Value / ws.Range("F4"))
Unload Me
End Sub
Since the smoke is all ready coming out of my ears
There is a delivery cost that need to be divided up and added to the total linear meter. So my last line of code need to change somehow.
Gentelmen and ladies, you are heroes
Rgeards Herco