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
| Sub MAJAdr()
Dim rep As String
rep = MsgBox("Etes vous sur de vouloir faire la mise à jour du listing adresses ?", vbOKCancel)
Select Case rep
Case 1
suppcheckBox
CopieAdr
InsertCheckBox
MsgBox "Mise à jour terminée"
Case Else
End Select
End Sub
------------------------------------------------------
Sub InsertCheckBox()
On Error GoTo Err_InsertCheckBox
Dim i As Integer
Dim n As Integer
Dim posleft As Variant
Dim postop As Variant
Dim posWidth As Variant
Dim posHeight As Variant
Dim car As String
car = ","
Initvar
For i = 2 To NbLigne
Sheets("listing adresses").Select
If Trim(Range("G" & i)) <> "" Then
Sheets("Tbd Envoi Annexes Mobile").Select
posleft = Replace(Range("C" & i).Left, car, ".")
postop = Replace(Range("C" & i).Top, car, ".")
posWidth = Replace(Range("C" & i).Width, car, ".")
posHeight = Replace(Range("C" & i).Height, car, ".")
ActiveSheet.CheckBoxes.Add(posleft, postop, posWidth, posHeight).Select
With Selection
.Value = True
.LinkedCell = "H" & i
.Text = ""
.Display3DShading = True
End With
End If
Next
Exit_InsertCheckBox:
Exit Sub
Err_InsertCheckBox:
MsgBox Err.Description
Resume Exit_InsertCheckBox
End Sub
---------------------------------------------------------------
Sub suppcheckBox()
Dim i As Integer
CptLigne
For i = 2 To NbLigne
Range("H" & i) = ""
Next
ActiveSheet.CheckBoxes.Delete
End Sub
---------------------------------------------------------------
Sub CopieAdr()
'
' CopieAdr Macro
' Macro enregistrée le 28/11/2008 par dqsf6548
Worksheets("listing adresses").Select
Columns("A:F").Select
Selection.Copy
Worksheets("Tbd Envoi Annexes Mobile").Select
Cells.Select
ActiveSheet.Paste
End Sub |