Hi all,
people here have been great with assistance (and I really am trying to learn so I don’t have to come back here all the time and only ask questions, want to be able to eventually contribute). Mr. Don Guillett has been immensely helpful but I’m stuck. I have a workbook, multiple sheets that are populated from several user forms. The amount of “data” that will be placed on each spreadsheet is varied and differs from sheet to sheet. Users that will be filling in the userforms will want a printed copy of the sheets. I need a way to dynamically format the sheets so that the data can be printed with each individual cell of data having a border. I need this to happen automatically and also need to allowe the user to go back and add data.
Mr. Guillet provided code that will format the “first” sheet correctly for printing.
The code is: (placed in ThisWorkBook)
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim myBorders
Dim i As Integer
Application.ScreenUpdating = 0
ActiveSheet.Range(“a1”).CurrentRegion.Select
Selection.Name = _
“‘” & ActiveSheet.Name & “‘!print_area”
myBorders = Array(, xlEdgeLeft, xlEdgeTop, xlEdgeBottom, xlEdgeRight)
For i = 1 To UBound(myBorders)
With Selection.Borders(myBorders(i))
.LineStyle = xlContinuous
.Weight = xlMedium
End With
Next
If Selection.Columns.Count > 1 Then _
Selection.Borders(xlInsideVertical).LineStyle = xlContinuous
If Selection.Rows.Count > 1 Then _
Selection.Borders(xlInsideHorizontal).LineStyle = xlContinuous
Range(“a1”).Select
aplication.ScreenUpdating = 1
End Sub
any suggestions on how to modify so that all sheets will be formatted, and also so that a user can go back and add additional data.
Thanks from a stuggling noob.