Sub LHPB()
Set ws = Worksheets("Sheet1")
For i = 1 To ws.HPageBreaks.Count
Worksheets("Sheet3").Cells(i, 1).Value = ws.HPageBreaks(i).Location.Row
MsgBox ws.HPageBreaks(i).Location.Row
Next
End Sub
aaa = Rows(Sheets("CSS_quote_sheet").HPageBreaks(NoPages).Location.Row).Top + 1
Sub cmdPush(user As String)
Dim a As Double, aa As Double, aaa As Double, DividerBottom As Long
Dim NoPages As Long
'Finds the number of pages
NoPages = ((ActiveSheet.HPageBreaks.Count + 1) * (ActiveSheet.VPageBreaks.Count + 1)) / 2
Application.ScreenUpdating = False
With Sheets("Sheet2")
.Shapes(user).Duplicate.Name = "Signature"
.Shapes("Signature").Cut
End With
Sheets("CSS_quote_sheet").Cells(43, 1).PasteSpecial
Sheets("CSS_quote_sheet").Shapes(Selection.Name).Name = "Signature"
a = Sheets("CSS_quote_sheet").Cells(LastRow, 1).End(xlUp).Offset(1).Top + 140
aa = Sheets("CSS_quote_sheet").Shapes("Signature").Height
aaa = Rows(Sheets("CSS_quote_sheet").HPageBreaks(NoPages).Location.Row).Top + 1
DividerBottom = Sheets("CSS_quote_sheet").Shapes("Divider").BottomRightCell.Row
With Sheets("CSS_quote_sheet").Shapes("Signature")
.Left = ActiveSheet.Range("A1").Left
.Top = IIf(a + aa > aaa, aaa, a)
.Placement = 1
End With
Application.ScreenUpdating = True
End Sub
Sub cmdPush(user As String)
Dim a As Double, aa As Double, aaa As Double, DividerBottom As Long
Dim NoPages As Long, ws As Worksheet
Set ws = Sheets("CSS_quote_sheet")
'Finds the number of pages
NoPages = ((ActiveSheet.HPageBreaks.Count + 1) * (ActiveSheet.VPageBreaks.Count + 1)) / 2
Application.ScreenUpdating = False
With Sheets("Sheet2")
.Shapes(user).Duplicate.Name = "Signature"
.Shapes("Signature").Cut
End With
ws.Cells(43, 1).PasteSpecial
ws.Shapes(Selection.Name).Name = "Signature"
a = ws.Cells(LastRow, 1).End(xlUp).Offset(1).Top + 140
aa = ws.Shapes("Signature").Height
aaa = Rows(ws.HPageBreaks(NoPages).Location.Row).Top + 1
DividerBottom = ws.Shapes("Divider").BottomRightCell.Row
With ws.Shapes("Signature")
.Left = ActiveSheet.Range("A1").Left
.Top = IIf(a + aa > aaa, aaa, a)
.Placement = 1
End With
Application.ScreenUpdating = True
End Sub
Function LastRow()
'Dim LastRow As Long
With Sheets("CSS_quote_sheet")
LastRow = .Range("A:H").Find(What:="*", _
After:=.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
End With
End Function
Sub cmdTraceySig()
Quoting.Unprotect Password:=ToUnlock
Dim user As String
user = "ImgT"
'Call cmdNoSig
Call cmdPush(user)
Quoting.Protect Password:=ToUnlock
End Sub
Sub cmdLynSig()
Quoting.Unprotect Password:=ToUnlock
Dim user As String
user = "ImgL"
Call cmdNoSig
Call cmdPush(user)
Quoting.Protect Password:=ToUnlock
End Sub
Sub cmdGarrettSig()
Quoting.Unprotect Password:=ToUnlock
Dim user As String
user = "ImgG"
Call cmdNoSig
Call cmdPush(user)
Quoting.Protect Password:=ToUnlock
End Sub
Sub cmdJonathanSig()
Quoting.Unprotect Password:=ToUnlock
Dim user As String
user = "ImgJ"
Call cmdNoSig
Call cmdPush(user)
Quoting.Protect Password:=ToUnlock
End Sub
Sub EmptyCellsInA()
Dim LO As ListObject, n As Long
Set LO = ActiveSheet.ListObjects("css_quote")
n = LO.DataBodyRange.Rows.Count - Application.CountA(LO.DataBodyRange.Columns(1))
MsgBox "There are " & n & " empty table cells in column A"
End Sub
Sub cmdNoSig()
Dim Pic As Object
For Each Pic In ActiveSheet.Pictures
If Pic.Name <> "lblActivities" And Pic.Name <> "TextBox3" And Pic.Name <> "lblNotes" And Pic.Name <> "cmdAdd_Nlines" And Pic.Name <> "cmdDeleteRow" And Pic.Name <> "cmdClearNotDates" And _
Pic.Name <> "cmdDelSelect" And Pic.Name <> "cmdGarrettB" And Pic.Name <> "cmdNoSignature" And Pic.Name <> "cmdSendTCT" And Pic.Name <> "cmdSort" And _
Pic.Name <> "cmdDeleteQuoteLines" And Pic.Name <> "ImgLogo" And Pic.Name <> "cmdCustom" And Pic.Name <> "chkIncrease" And Pic.Name <> "lblIncrease" And _
Pic.Name <> "cmdTraceyS" And Pic.Name <> "cmdLynL" And Pic.Name <> "cmdJonathanA" And Pic.Name <> "cmdPrintPdf" And Pic.Name <> "cmdQuoteTips" And _
Pic.Name <> "Label1" And Pic.Name <> "cmdSendTCTPrint" And Pic.Name <> "textbox4" And Pic.Name <> "lblNotes" And Pic.Name <> "CommandButton1" And Pic.Name <> "cmdUnlock" Then
' If Not Intersect(Pic.TopLeftCell, Range("A12:A300")) Is Nothing Then
Pic.Delete
'End If
End If
Next Pic
End Sub
Sub cmdPush(user As String)
Dim a As Double, aa As Double, aaa As Double, DividerBottom As Long, ws As Worksheet
Dim n As Long
Set ws = Worksheets("CSS_quote_sheet")
n = ws.HPageBreaks.Count
Application.ScreenUpdating = False
With Sheets("Sheet2")
.Shapes(user).Duplicate.Name = "Signature"
.Shapes("Signature").Cut
End With
Sheets("CSS_quote_sheet").Cells(43, 1).PasteSpecial
Sheets("CSS_quote_sheet").Shapes(Selection.Name).Name = "Signature"
a = Sheets("CSS_quote_sheet").Cells(LastRow, 1).End(xlUp).Offset(1).Top + 140
aa = Sheets("CSS_quote_sheet").Shapes("Signature").Height
aaa = Rows(Sheets("CSS_quote_sheet").HPageBreaks(n).Location.Row).Top + 1
DividerBottom = Sheets("CSS_quote_sheet").Shapes("Divider").BottomRightCell.Top
With Sheets("CSS_quote_sheet").Shapes("Signature")
.Left = ActiveSheet.Range("A1").Left
.Top = IIf(a + aa > aaa, a, DividerBottom + 140)
.Placement = 1
End With
Application.ScreenUpdating = True
End Sub
Sub cmdPush(user As String)
Dim TopLastRowPlusSpace As Double, ImageHeight As Double, TopOfLowestPageBreak As Double, DividerBottom As Long, ws As Worksheet
Dim n As Long
Set ws = Worksheets("CSS_quote_sheet")
n = ws.HPageBreaks.Count
Application.ScreenUpdating = False
With Sheets("Sheet2")
.Shapes(user).Duplicate.Name = "Signature"
.Shapes("Signature").Cut
End With
Sheets("CSS_quote_sheet").Cells(43, 1).PasteSpecial
Sheets("CSS_quote_sheet").Shapes(Selection.Name).Name = "Signature"
TopLastRowPlusSpace = Sheets("CSS_quote_sheet").Cells(LastRow, 1).End(xlUp).Offset(1).Top + 140
ImageHeight = Sheets("CSS_quote_sheet").Shapes("Signature").Height
TopOfLowestPageBreak = Rows(Sheets("CSS_quote_sheet").HPageBreaks(n).Location.Row).Top + 1
DividerBottom = Sheets("CSS_quote_sheet").Shapes("Divider").BottomRightCell.Top
With Sheets("CSS_quote_sheet").Shapes("Signature")
.Left = ActiveSheet.Range("A1").Left
.Top = IIf(TopLastRowPlusSpace + ImageHeight > TopOfLowestPageBreak, TopOfLowestPageBreak + 140, TopLastRowPlusSpace)
.Placement = 1
End With
Application.ScreenUpdating = True
End Sub
TopOfLowestPageBreak = Rows(Sheets("CSS_quote_sheet").HPageBreaks(n + 1).Location.Row).Top + 1
Sub cmdPush(user As String)
Dim TopLastRowPlusSpace As Double, ImageHeight As Double, TopOfLowestPageBreak As Double, DividerBottom As Long, ws As Worksheet
Dim n As Long
Set ws = Worksheets("CSS_quote_sheet")
n = ws.HPageBreaks.Count
Application.ScreenUpdating = False
With Sheets("Sheet2")
.Shapes(user).Duplicate.Name = "Signature"
.Shapes("Signature").Cut
End With
Sheets("CSS_quote_sheet").Cells(43, 1).PasteSpecial
Sheets("CSS_quote_sheet").Shapes(Selection.Name).Name = "Signature"
TopLastRowPlusSpace = Sheets("CSS_quote_sheet").Cells(LastRow, 1).End(xlUp).Offset(1).Top + 140
ImageHeight = Sheets("CSS_quote_sheet").Shapes("Signature").Height
TopOfLowestPageBreak = Rows(Sheets("CSS_quote_sheet").HPageBreaks(n + 1).Location.Row).Top + 1
DividerBottom = Sheets("CSS_quote_sheet").Shapes("Divider").BottomRightCell.Top
With Sheets("CSS_quote_sheet").Shapes("Signature")
.Left = ActiveSheet.Range("A1").Left
.Top = IIf(TopLastRowPlusSpace + ImageHeight > TopOfLowestPageBreak, TopOfLowestPageBreak + 140, TopLastRowPlusSpace)
.Placement = 1
End With
Application.ScreenUpdating = True
End Sub