Hi Wolfmasterr
Not sure whether this post posted, so here goes again.
I take it that you use row 14 only to input the info for your receipt?
Set up your receipt sheet (Sheet 2) as suggested. Use Column A as your
headings. In row 14 on your other sheet, create a field called Number in
cell F14, and insert the next receipt number there.
Now press<Alt><F11>, click on Insert| Module, and copy the following code
there:
Dim cRoom As Long
Dim pAmount As Integer
Dim dFrom As Date
Dim dTo As Date
Dim cells
Worksheets("Sheet1").Activate
If IsEmpty(Range("A14")) Then
GoTo Errorhandler
End If
rNumber = Range("F14")
cName = Range("A14")
cRoom = Range("B14")
pAmount = Range("C14")
dFrom = Range("D14")
dTo = Range("E14")
Worksheets("Sheet2").Activate
Range("D3") = rNumber
Range("D5") = Now()
Range("B7") = cName
Range("B9") = pAmount
Range("B12") = cRoom
Range("B14") = dFrom
Range("D14") = dTo
Range("A1
14").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Worksheets("Sheet1").Activate
Range("A14:E14").ClearContents
rNumber = rNumber + 1
Range("F14") = rNumber
Exit Sub
Errorhandler:
MsgBox ("Please complete details before attempting this operation")
Exit Sub
End Sub
I would suggest that you add code to save your work, after every receipt is
printed, to ensure that your numbers are always correct. You run this macro
by pressing <Alt><F8>, selecting the macro and clicking on Run. You can also
add a button to the right of, or below the current input range on Sheet 1,
and run the macro from there.