print row

  • Thread starter Thread starter jamie85
  • Start date Start date
J

jamie85

Private Sub CommandButton1_Click()
Dim LastRow As Object

Range("A2").Select
ActiveSheet.ShowDataForm



End Sub

Is there a way that when i enter a new record using my data form, a ne
row is also printed?

Also how would i go about creating code for a print preveiw button?

Thank
 
Try this to print the row with the last value in column A

Sub test()
Dim lr As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
Rows(lr).PrintOut
End Sub


And use this for the PrintPreview

ActiveSheet.PrintPreview
 
If you don't set a print area, the default behavior should be to print all
the data in the worksheet.

Private Sub CommandButton1_Click()
Activesheet.PrintPreview
End Sub
 
Patience Jamie, patience.

Only been 17 minutes since your first posting.

Gord Dibben Excel MVP
 
Back
Top