AW: Nachfrage..
26.10.2017 09:16:22
UweD
Hallo
Die Datümer in AC- AD braucht du nicht, das wird direkt in VBA gemacht
Ausgangsdaten
Tabelle1 | AA | AB | AC | AD | AE |
1 | Auftrag | Fällig | 1. Nachfrage | 2. Nachfrage | 3. Nachfrage |
2 | A100 | 26.10.2017 | 10.11.2017 | 13.11.2017 | 17.11.2017 |
3 | A 200 | 27.11.2017 | 12.12.2017 | 15.12.2017 | 19.12.2017 |
4 | A 300 | 28.05.2017 | 12.06.2017 | 15.06.2017 | 19.06.2017 |
5 | A 400 | 29.10.2017 | 13.11.2017 | 16.11.2017 | 20.11.2017 |
6 | B 222 | 10.10.2017 | 25.10.2017 | 28.10.2017 | 01.11.2017 |
7 | C 444 | 07.10.2017 | 22.10.2017 | 25.10.2017 | 29.10.2017 |
8 | F 900 | 06.10.2017 | 21.10.2017 | 24.10.2017 | 28.10.2017 |
verwendete Formeln | |
Zelle | Formel | Bereich | N/A |
AC2:AC8 | =AB2+15 | | |
AD2:AD8 | =AB2+18 | | |
AE2:AE8 | =AB2+22 | | |
http://excel-inn.de/dateien/vba_beispiele/tabellenanzeige_in_html_addin.zip |
http://Hajo-Excel.de/tools.htm
|
XHTML-Tabelle zur Darstellung in Foren, einschl. der neuen Funktionen ab Version 2007 |
Add-In-Version 21.10 einschl. 64 Bit |
in DieseArbeitsmappe
Private Sub Workbook_Open()
Dim TB As Worksheet, SP As Integer, ZE As Integer, LR As Double
Dim Faellig As Date, E1 As Integer, E2 As Integer, E3 As Integer
Dim AF As String, TextA As String, TextB As String, TextC As String
Dim i As Double
E1 = 15
E2 = 18
E3 = 22
Set TB = Sheets("Tabelle1")
SP = 28 'Spalte AB
ZE = 2 'erste DatenZeile
LR = TB.Cells(TB.Rows.Count, SP).End(xlUp).Row 'letzte Zeile der Spalte
For i = ZE To LR
Faellig = TB.Cells(i, SP)
AF = TB.Cells(i, SP).Offset(0, -1)
If IsDate(Faellig) Then
If Date - Faellig >= E3 Then
TextC = TextC & AF & " vom " & Faellig & vbLf
ElseIf Date - Faellig >= E2 Then
TextB = TextB & AF & " vom " & Faellig & vbLf
ElseIf Date - Faellig >= E1 Then
TextA = TextA & AF & " vom " & Faellig & vbLf
End If
End If
Next
MsgBox "Fällig seit " & E3 & " Tagen" & vbLf & _
"-----" & vbLf & TextC & vbLf & vbLf & _
"Fällig seit " & E2 & " Tagen" & vbLf & _
"-----" & vbLf & TextB & vbLf & vbLf & _
"Fällig seit " & E1 & " Tagen" & vbLf & _
"-----" & vbLf & TextA
End Sub
LG UweD