Thanks Hans. your modification works the way I want.
I'm using the following lines under the button Print
Code: Select all
Private Sub cmdPrint_Click()
Me.Hide
With Worksheets("DonationReport")
.Visible = xlSheetVisible
.Range("G36") = Me.txtTime
.Range("C10") = Me.txtDonorID
.Range("C25") = Me.txtRecipientID
.Range("C35") = Me.cboStaffName
.Range("C37") = Me.txtExpiryDate
End With
Dim r As Long
With Worksheets("Inve")
r = .Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1
.Range("B" & r) = Me.txtTime
.Range("D" & r) = Me.txtDonorID
.Range("E" & r) = Me.txtRecipientID
.Range("F" & r) = Me.cboStaffName
End With
With Worksheets("DonationResult")
r = .Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1
.Range("B" & r) = Me.txtTime
.Range("D" & r) = Me.txtDonorID
.Range("E" & r) = Me.txtRecipientID
.Range("F" & r) = Me.cboStaffName
.Range("G" & r) = Me.cboResult
.Range("J" & r) = Me.cboMethod
.Range("M" & r) = Me.txtExpiryDate
End With
End Sub
I just wanted to know that where should I place the following to the above code in order to function. Should the following code be added just above the end sub line?
Code: Select all
Dim strSentence As String
strSentence = Me.lblTheProductOf.Caption & " " & Me.txtDonor & " " & _
Me.lblIs.Caption & " "& Me.cboAcceptable & " " & Me.lblWithThatOf.Caption & " " & _
Me.txtRecipient & " " & Me.lblBy.Caption & " " & Me.cboLaw & " " & _
Me.lblWithSatisfactoryResults.Caption
Worksheets("Donation").Range("A9") = strSentence
I would be pleased if you could hep me with this.
Thanks in advance.
Regards
Adam
Dim strSentence As String
strSentence = Me.lblTheProductOf.Caption & " " & Me.txtDonor & " " & _
Me.lblIs.Caption & " "& Me.cboAcceptable & " " & Me.lblWithThatOf.Caption & " " & _
Me.txtRecipient & " " & Me.lblBy.Caption & " " & Me.cboLaw & " " & _
Me.lblWithSatisfactoryResults.Caption
Worksheets("Donation").Range("A9") = strSentence[/code]