Userform within a userform ...
Hi Bob -
Thanks for a quick response ... tried your idea, but didn't work ...
Here's the whole code segment:
Private Sub CommandButton3_Click()
Prnting.Show
'Adjust column-widths for printing
With Sheet2
With .Range("Z1:AF1")
.EntireColumn.AutoFit
End With
For Each C In .Columns("Z:AF")
C.ColumnWidth = C.ColumnWidth * 1.5
Next
.Columns("AC").ColumnWidth = .Columns("AC").ColumnWidth *
0.7
' Set formatting
With .Range("Z1:AF1")
.Borders.LineStyle = xlContinuous
.Borders.Weight = xlMedium
.Font.Bold = True
End With
End With
Sheet2.Range("Z1:AE1").EntireColumn.HorizontalAlig nment =
xlCenter
Sheet2.Range("AF1").HorizontalAlignment = xlCenter
'Set the Print-Area
With Sheet2
.Range("Z1").CurrentRegion.Name = "PrintReport"
With .PageSetup
.PrintArea = "PrintReport"
.Orientation = xlLandscape
.CenterHorizontally = True
.BottomMargin = 0.5
.TopMargin = 1#
.LeftMargin = 0.5
.RightMargin = 0.5
.FitToPagesTall = 1
.FitToPagesWide = 1
.PrintGridlines = True
.LeftHeader = "&""Verdana,Bold""& 20" & "Missed Punch
Report"
.RightHeader = "Printed on: " & Format(Now, "mm/dd/yy")
End With
End With
PrintDone.Show
Unload Me
End Sub
|