printing problem

  • Thread starter Thread starter Robert Couchman
  • Start date Start date
R

Robert Couchman

Hello,

The message board doesnt seem very busy today! feels like
friday!

anyway,

i have a problem with my printing command, i am trying to
set the printout so that the "fit to page" option can take
a variable from a textbox on a form.

i have the following:--

.FitToPagesWide = textbox1.value
.FitToPagesTall = textbox2.value

but it doesnt work, it says that it cant understand the
command (yes i am using a with command)

can anyone please help?

the original (and working) way for this code was:--

.FitToPagesWide = 1
.FitToPagesTall = 3

Thank you,

Robert Couchman
([email protected])
 
All sorts of things to go wrong with this one. No lazy programmin
allowed (grin). Assuming suitable data entry (another grin) :-

'----------------------------------
Sub test()
Dim p1 As Integer
Dim p2 As Integer
p1 = UserForm1.TextBox1.Value
p2 = UserForm1.TextBox2.Value
With ActiveSheet.PageSetup
.Zoom = False
.FitToPagesWide = p1
.FitToPagesTall = p2
End With
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

Similar Threads

Problem formatting header font size 1
Code is not working 1
Fit to page macro 3
Adding "fit to" into current print code 2
Print Code not working 1
Print Ranges 7
Print Setup Not Set 1
Print area problem 1

Back
Top