CommandButtons relocate on worksheet when code runs ??

C

Corey

Just recently i have found that when i use a button to chech the number of pages needed to print
and print them,
ALL (but 1) CommandButton moves fromt he Right side to the left side of the page?


Why is it so?

Sub PrintReport() ' prints report worksheet
Call SetPrintAreaR
If Cells(22, 1).Value < 1 Then
Exit Sub
Else
ActiveWindow.ActiveSheet.PrintOut Copies:=1, Collate:=True
End If
End Sub

~~~~~~~~~~~~~~~~~~~~~~~~~~

Sub SetPrintAreaR() ' sets print area of Map according to No. of events
If Cells(22, 1).Value = 0 Then
ActiveSheet.PageSetup.PrintArea = "$A$1:$H$26" ' base area
MsgBox "There are No Events detected in the Report! ", vbOKOnly, sTitle ' warning
Else
ActiveSheet.PageSetup.PrintArea = "$A$1:$H$" & ((Cells(22, 1).Value * 4) + 22) ' calculates
where entered events cease
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top