Lil Stinker
Board Regular
- Joined
- Feb 16, 2022
- Messages
- 142
- Office Version
- 2019
- Platform
- Windows
Total noob at VBA so apologies up front.
I have this code to automatically enter details to an invoice record.
Second problem, I need dt_due to reference E9 but when E9 is empty, I need it to reference E27.
I have this code to automatically enter details to an invoice record.
Problem is, I need to reference J1 & K1 for the full quote number (qtno). My quote number has letters in J1 and numbers in K1. K1 increments with each new quote. J1's initials change with each user.Sub QuoteRecord()
Dim qtno As String
Dim custname As String
Dim projname As String
Dim amt As Currency
Dim dt_issue As Date
Dim dt_due As Date
Dim nextrec As Range
qtno = Range("K1")
custname = Range("B3")
projname = Range("B2")
amt = Range("K40")
dt_issue = Range("K4")
dt_due = Range("E9")
Set nextrec = Sheet4.Range("A1048576").End(xlUp).Offset(1, 0)
nextrec = qtno
nextrec.Offset(0, 1) = custname
nextrec.Offset(0, 2) = projname
nextrec.Offset(0, 3) = amt
nextrec.Offset(0, 4) = dt_issue
nextrec.Offset(0, 5) = dt_due
End Sub
Second problem, I need dt_due to reference E9 but when E9 is empty, I need it to reference E27.