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
'-------------------------------
--
Message posted from
http://www.ExcelForum.com