Bonjour,
Etant novice en Vba ma macro stop sur le code suivant a l'endroit en gras :
( a noter sur mon fichier lors du beug et que je vais sur curcell.row en gras "32768" est affiché)
'fonction retourne le tableau des références
Function getRef()
Sheets("Reporting").Select
Dim ref() As Integer
'ReDim ref(Application.Subtotal(3, [A3:A15000]))
Dim plage As Range
Dim CurCell As Range
Dim pDoc As Integer
Dim deDoc As Integer
ce la donnerait quoi après correction? Integer: -32765 a +32767 donc 32768 trop grand pour integer, prendre Long et cherchez les limites d'un entier long vous comprendrez peut-etre!
Merci, je comprends
Lorsque j'intègre la variable erreur de compilation une constante est requise entre les champs en gras
fonction retourne le tableau des références
Function getRef() Sheets("Reporting").Select
Dim ref() As Integer
'ReDim ref(Application.Subtotal(3, [A3:A15000]))
Dim plage As Range
Dim CurCell As Range
Dim pDoc As Integer
Dim deDoc As Integer
je suis vraiment novice de chez novice
ce la donnerait quoi après correction?
ce la donnerait quoi après correction?
Integer: -32765 a +32767 donc 32768 trop grand pour integer, prendre Long et cherchez les limites d'un entier long vous comprendrez peut-etre!
Lorsque j'intègre la variable erreur de compilation une constante est requise entre les champs en gras
fonction retourne le tableau des références
Function getRef()
Sheets("Reporting").Select
Dim ref() As Integer
'ReDim ref(Application.Subtotal(3, [A3:A15000]))
Dim plage As Range
Dim CurCell As Range
Dim pDoc As Integer
Dim deDoc As Integer
pDoc = Range("A2:A" & Range("A65536").End(xlUp).Row).SpecialCells(xlVisible).Cells(1, 1).Row
deDoc = Range("A65536").End(xlUp).Row
Set plage = Range(Cells(pDoc, 1), Cells(deDoc, 1)).SpecialCells(xlCellTypeVisible)
i = 0
For Each CurCell In plage.Rows
ReDim Preserve ref(i)
ref(i) = Cells(CurCell.Row, "D").Row
Dim ref(i) As Long
i = i + 1
Next
getRef = ref
End Function
Z'etes vraiment novice, il faut mettre cette declaration a la place de l'autre