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
| Option Explicit
Sub TestVide()
Dim TB As Variant
Dim Message As String
Dim i As Integer
TB = Array("G8", "G9", "G11", "G12", "G18", "G19", "G20", "G29", "G30", "G35", "G36", "G37", "H42", "H43", "H44", "K35", "L18", "L19", "L20", "L29", "O11", "O12", "P18", "P19", "P20", "P22", "P30", "Q42", "Q43", "R42")
For i = 0 To UBound(TB)
If Range(TB(i)) = "" Then
Message = Message & vbCrLf & vbTab & TB(i)
End If
Next i
If Message <> "" Then
MsgBox "Following cells have not been filled:" & vbCrLf & Message & vbCrLf & vbCrLf & "Do you want to save it all the same?", vbYesNo + vbInformation + vbDefaultButton2, "File is not completely filled."
If vbNo Then
For i = 0 To UBound(TB)
If Range(TB(i)) = "" Then
Exit For
End If
Next i
Application.Goto Reference:=ActiveSheet.Range(TB(i))
Exit Sub
Else
GoTo Save
End If
Else
GoTo Save
End If
Save:
Dim MonFichier
MonFichier = Range("G8").Value & Range("G12").Value & ".xls"
ChDir "blabla"
ActiveWorkbook.SaveAs Filename:=MonFichier, FileFormat:=xlNormal
End Sub |
Partager