Hi All,
Can someone tell me what I'm doing wrong? I'm trying to print out a schedule each day that's created by filling out a form. After the schedule is made I want to set the print area and print the page based on what ever size it happens to be that day. I keep getting a run time error on the ActiveSheet line of this code:
Sub Button4_Click()
Dim LR As Integer
Dim LC As Integer
LR = Cells.Find("*", [A1], xlFormulas, xlPart, xlByRows, xlPrevious, False, False).Column
Worksheets("Schedule").Activate
ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells(LR, LC)).Address
Range(Cells(1, 1), Cells(LR, LC)).Select
ActiveSheet.PrintOut
Sheets("Menu").Select
End Sub
Please help,
Skip
Can someone tell me what I'm doing wrong? I'm trying to print out a schedule each day that's created by filling out a form. After the schedule is made I want to set the print area and print the page based on what ever size it happens to be that day. I keep getting a run time error on the ActiveSheet line of this code:
Sub Button4_Click()
Dim LR As Integer
Dim LC As Integer
LR = Cells.Find("*", [A1], xlFormulas, xlPart, xlByRows, xlPrevious, False, False).Column
Worksheets("Schedule").Activate
ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells(LR, LC)).Address
Range(Cells(1, 1), Cells(LR, LC)).Select
ActiveSheet.PrintOut
Sheets("Menu").Select
End Sub
Please help,
Skip