Moderatori: Anthony47, Flash30005
Function GimmiPage(Optional ByRef myRan As Range) As Long
Dim VB As HPageBreak, cHBRow As Long, hPBc As Long, vPBc As Long
Dim cPage As Long, pSh As Worksheet, I As Long, J As Long
'
'Restituisce il numero di pagina del riferimento o della cella con la formula
Application.Volatile
If myRan Is Nothing Then
Set myRan = Application.Caller
End If
Set pSh = myRan.Parent
'
hPBc = pSh.HPageBreaks.Count
vPBc = pSh.VPageBreaks.Count
'
'1:Check H Breaks
For I = 1 To hPBc
If myRan(1, 1).Row < pSh.HPageBreaks(I).Location.Row Then
cPage = I
Exit For
End If
Next I
If cPage = 0 Then
If hPBc = 0 Then
cPage = 1
Else
cPage = I
End If
End If
'2: Check V Breaks
If vPBc >= 0 Then
For I = 1 To vPBc
If myRan.Column < pSh.VPageBreaks(I).Location.Column Then
J = I
Exit For
End If
Next I
If J > 0 Then J = J - 1 Else J = vPBc
cPage = cPage + (hPBc + 1) * J
End If
GimmiPage = cPage
End Function
=GimmiPage()
=SCEGLI(GimmiPage();"Prima Pagina";"Seconda pagina";"Terza pagina";"Quarta pagina")
=GimmiPage(Foglio1!G52)
Torna a Applicazioni Office Windows
Pagine web che si aprono e chiudono velocemente Autore: nippon |
Forum: Sistemi Operativi Windows Risposte: 7 |
Problema stampa due pagine Excel su foglio A4 Autore: dipdip |
Forum: Applicazioni Office Windows Risposte: 11 |
come inserire dei link in un documento? Autore: terrybella |
Forum: Applicazioni Office Windows Risposte: 5 |
Visitano il forum: Nessuno e 12 ospiti