Select Case to array
Hey er der en skal kan hjælpe med at lave den her om til arrayved ikke lige hvordan jeg bruger et array :S
Select Case (Cells(r, 5))' 11 - 17 - 23 Der er 4 select case som end her
Case C1
MSG = MSG & Ms1 & Fr & Format(Cells(r, 6), "hh:mm") & " " & Cells(r, 7) & Ti & Format(Cells(r, 8), "hh:mm") & " " & Cells(r, 9) & vbCrLf
Case C2
MSG = MSG & Ms2 & Fr & Format(Cells(r, 6), "hh:mm") & " " & Cells(r, 7) & Ti & Format(Cells(r, 8), "hh:mm") & " " & Cells(r, 9) & vbCrLf
Case C3
MSG = MSG & Ms3 & Fr & Format(Cells(r, 6), "hh:mm") & " " & Cells(r, 7) & Ti & Format(Cells(r, 8), "hh:mm") & " " & Cells(r, 9) & vbCrLf
Case C4
MSG = MSG & Ms4 & Fr & Format(Cells(r, 6), "hh:mm") & " " & Cells(r, 7) & Ti & Format(Cells(r, 8), "hh:mm") & " " & Cells(r, 9) & vbCrLf
Case 11 To 35
MSG = MSG & MsH1 & Cells(r, 5) & Fr & Format(Cells(r, 6), "hh:mm") & " " & Cells(r, 7) & Ti & Format(Cells(r, 8), "hh:mm") & " " & Cells(r, 9) & vbCrLf
If Dir(Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kl1 & Filnavn) <> "" Then
If Dir(Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kv1 & Filnavn) <> "" Then
mailThis.Attachments.Add Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kl1 & Filnavn
mailThis.Attachments.Add Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kv1 & Filnavn
Else
mailThis.Attachments.Add Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kl1 & Filnavn
End If
Else
If Dir(Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kl2 & Filnavn) <> "" Then
If Dir(Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kv2 & Filnavn) <> "" Then
mailThis.Attachments.Add Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kl2 & Filnavn
mailThis.Attachments.Add Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kv2 & Filnavn
Else
mailThis.Attachments.Add Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kl2 & Filnavn
End If
Else
If Dir(Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kl3 & Filnavn) <> "" Then
If Dir(Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kv3 & Filnavn) <> "" Then
mailThis.Attachments.Add Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kl3 & Filnavn
mailThis.Attachments.Add Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kv3 & Filnavn
Else
mailThis.Attachments.Add Disk & Format(Now(), "yyyy") & Format(Now() + Cells(2, 30), "mm") & Format(Now() + 1, "dd") & Vv1 & Cells(r, 5) & Kl3 & Filnavn
End If
End If
End If
End If
Case Else
End Select
