M
Martin
The code below returns the position of a vertical page break. I would like
add some code that will return the value of cell i5, where "i" is the column
of each page. The print area is set to D7:CB21 and the cell values I need
are on D5:CB21. Can someone help me with this.
Thanks.
Sub TestPageBreaks()
Dim wksCurrent As Worksheet
Dim iVBreak As Integer
Dim strMessage As String
Set wksCurrent = ActiveSheet
For iVBreak = 1 To wksCurrent.VPageBreaks.Count
strMessage = "Address: " &
wksCurrent.VPageBreaks(iVBreak).Location.Address & _
vbCrLf & _
"Value: " & wksCurrent.VPageBreaks(iVBreak).Location.Cells(i,
5)
MsgBox strMessage, vbOKOnly, "Page Break Test"
Next iVBreak
Set wksCurrent = Nothing
End Sub
add some code that will return the value of cell i5, where "i" is the column
of each page. The print area is set to D7:CB21 and the cell values I need
are on D5:CB21. Can someone help me with this.
Thanks.
Sub TestPageBreaks()
Dim wksCurrent As Worksheet
Dim iVBreak As Integer
Dim strMessage As String
Set wksCurrent = ActiveSheet
For iVBreak = 1 To wksCurrent.VPageBreaks.Count
strMessage = "Address: " &
wksCurrent.VPageBreaks(iVBreak).Location.Address & _
vbCrLf & _
"Value: " & wksCurrent.VPageBreaks(iVBreak).Location.Cells(i,
5)
MsgBox strMessage, vbOKOnly, "Page Break Test"
Next iVBreak
Set wksCurrent = Nothing
End Sub