1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| Private x_val As Integer
Private y_val As Integer
Private titre As String
Private Header As Range
Private Mysurface As Range
Private MyCorps As Range
Private MyCorps1 As clCorps1
Private Sub Class_Initialize()
Dim uk As clCorps1
Set uk = New clCorps1
Me.Corps1 = uk
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Let Corps1(Val As clCorps1)
Set MyCorps1 = Val
End Property
Public Property Get Corps1() As clCorps1
Set Corps1 = MyCorps1
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub Class_Terminate()
Header.Value = vbNullString
Call deleteName(titre)
Set Header = Nothing
Set MyCorps1 = Nothing
End Sub
Public Property Get Colonne()
Colonne = x_val
End Property
Public Property Let Colonne(x)
x_val = x
End Property
Public Property Get Lignes()
Lignes = y_val
End Property
Public Property Let Lignes(x)
y_val = x
End Property
Public Property Get Title()
Title = titre
End Property
Public Property Let Title(d)
titre = d
Header.Value = d
Header.Parent.Names.Add Name:=d, RefersTo:="=" & CStr(Header.Parent.Name) & "!" & CStr(Header.AddressLocal)
End Property
Public Property Get Entete()
Set Entete = Header
End Property
Public Property Let Entete(dsss)
For Each Item In ActiveSheet.Cells
If Item.Address = dsss Then
Set Header = Item
Exit For
End If
Next Item
End Property
Public Property Get Surface()
Set Surface = Mysurface
End Property
Public Property Get Corps()
Set Corps = MyCorps
End Property
Public Sub Init(Header As Range, Lignes As Long, Colonnes As Integer, Lignes1, Colonnes1)
Set Mysurface = Header.Parent.Range(Header, Header(Lignes, Colonnes))
Set MyCorps = Header.Parent.Range(Header.Offset(1, 1), Header(Lignes, Colonnes))
Set MyCorps1 = Range("A1")
End Sub
Public Sub EffaceTout()
Mysurface.ClearContents
End Sub
Public Sub EffaceCorps()
MyCorps.ClearContents
End Sub
Sub deleteName(arg1)
Header.Parent.Names(arg1).Delete
End Sub |