PC Review


Reply
Thread Tools Rate Thread

CommandButtons relocate when printing

 
 
Corey
Guest
Posts: n/a
 
      7th May 2007
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....


 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      7th May 2007
Corey,
Did you read my reply to your previous post ?

NickHK

"Corey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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....
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CommandButtons relocate on worksheet when code runs ?? Corey Microsoft Excel Programming 1 4th May 2007 06:46 AM
Commandbuttons =?Utf-8?B?U3RldmU=?= Microsoft Excel Programming 2 5th Jan 2007 01:36 AM
CommandButtons =?Utf-8?B?TWF0cyBTYW1zb24=?= Microsoft Excel Programming 4 17th Jan 2006 02:19 PM
Commandbuttons PCOR Microsoft Excel Programming 1 11th May 2004 11:21 PM
CommandButtons SusanM Microsoft Access Forms 2 1st Mar 2004 09:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:06 PM.