ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CommandButtons relocate when printing (https://www.excelbanter.com/excel-programming/388839-commandbuttons-relocate-when-printing.html)

Corey

CommandButtons relocate when printing
 
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 Report 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


Whne i run the PrintReport macro, after the printing occurs, 12 CommandButton on the Right hand side
of the page, for some reason relocate themselves accross to the left hand side at about level with
column B/C ????


Why does this occur?
Why does 1 CommandButton NOT move then?

How can i prevent this ?

Corey....



NickHK

CommandButtons relocate when printing
 
Corey,
Did you read my reply to your previous post ?

NickHK

"Corey" wrote in message
...
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 Report 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


Whne i run the PrintReport macro, after the printing occurs, 12

CommandButton on the Right hand side
of the page, for some reason relocate themselves accross to the left hand

side at about level with
column B/C ????


Why does this occur?
Why does 1 CommandButton NOT move then?

How can i prevent this ?

Corey....






All times are GMT +1. The time now is 01:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com