In support of this Thread:
http://www.eileenslounge.com/viewtop...271368#p271368
Code:'Second half worksheet Consultant doctor ' Main formatting With ThisWorkbook.Worksheets("Consultant doctor").UsedRange .Font.Name = "Times New Roman" .Font.Size = 13 .Columns("D:X").NumberFormat = "0.00" .EntireColumn.AutoFit End With ' For Cnt = 34 To ((Segs * 27) + ((Segs - 1) * 7) + 7) Step 34 With ThisWorkbook.Worksheets("consultant doctor") ' Most borders .Range("A" & Cnt & "").Offset(-27, 0).Resize(29, 24).Borders.LineStyle = xlContinuous ' Sum formulas .Range("D" & Cnt + 1 & ":X" & Cnt + 1 & "").Value = "=IF(SUM(R[-28]C:R[-1]C)=0,"""",SUM(R[-28]C:R[-1]C))" .Range("D" & Cnt + 7 & ":X" & Cnt + 7 & "").Value = "=R[-6]C" ' First signature Second signature third signature Fourth signature Fifth signature .Range("A" & Cnt + 2 & ":X" & Cnt + 2 & "").Value = Array("", "First signature", "", "", "", "", "Second signature", "", "", "", "", "Third signature", "", "", "", "", "Fourth signature", "", "", "", "", "Fifth Signature", "", "") ' Bold stuff .Range("A" & Cnt & "").Offset(1, 0).Resize(7, 24).Font.Bold = True .Range("A" & Cnt + 1 & "").Value = "The total" .Range("A" & Cnt + 7 & "").Value = "Previous total" ' HPageBreaks.Add .HPageBreaks.Add .Range("A" & Cnt + 7 & "") End With ' ThisWorkbook.Worksheets("consultant doctor") Next Cnt
Code:'Second half worksheet Specialist Doctor ' Main formatting With ThisWorkbook.Worksheets("Specialist Doctor").UsedRange .Font.Name = "Times New Roman" .Font.Size = 13 .Columns("D:X").NumberFormat = "0.00" .EntireColumn.AutoFit End With ' For Cnt = 34 To ((Segs * 27) + ((Segs - 1) * 7) + 7) Step 34 With ThisWorkbook.Worksheets("Specialist Doctor") ' Most borders .Range("A" & Cnt & "").Offset(-27, 0).Resize(29, 24).Borders.LineStyle = xlContinuous ' Sum formulas .Range("D" & Cnt + 1 & ":X" & Cnt + 1 & "").Value = "=IF(SUM(R[-28]C:R[-1]C)=0,"""",SUM(R[-28]C:R[-1]C))" .Range("D" & Cnt + 7 & ":X" & Cnt + 7 & "").Value = "=R[-6]C" ' First signature Second signature third signature Fourth signature Fifth signature .Range("A" & Cnt + 2 & ":X" & Cnt + 2 & "").Value = Array("", "First signature", "", "", "", "", "Second signature", "", "", "", "", "Third signature", "", "", "", "", "Fourth signature", "", "", "", "", "Fifth Signature", "", "") ' Bold stuff .Range("A" & Cnt & "").Offset(1, 0).Resize(7, 24).Font.Bold = True .Range("A" & Cnt + 1 & "").Value = "The total" .Range("A" & Cnt + 7 & "").Value = "Previous total" ' HPageBreaks.Add .HPageBreaks.Add .Range("A" & Cnt + 7 & "") End With ' ThisWorkbook.Worksheets("Specialist Doctor") Next Cnt




Reply With Quote
Bookmarks