Ich bin neu in VBA also bitte bitte mit mir. Ich habe eine harte Zeit mit diesem Code:Wie man ein Array in eine Variable speichert - VBA
Dim arrayAC() As Variant
Dim arrayW() As Variant
Dim DD As date
Dim LrowAC As Integer
Dim LrowW As Integer
LrowAC = Worksheets("A").Columns(29).Find(What:="*", LookIn:=xlValues, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
LrowW = Worksheets("A").Columns(23).Find(What:="*", LookIn:=xlValues, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
ReDim arrayAC(1 To LrowAC + 1)
ReDim arrayW(1 To LrowW + 1)
For i = 3 To LrowAC + 1
arrayAC(i) = Worksheets("A").Cells(i, 29)
Next i
i = 3
For h = 3 To LrowW + 1
arrayW(h) = Worksheets("A").Cells(h, 23)
Next h
h = 3
For i = 3 To LrowAC + 1
For h = 3 To LrowW + 1
If arrayAC(i) = arrayW(h) Then
DD = arrayAC(i)
Worksheets("A").Cells(i, "X").Value = DD
end if
next h
next i
DD erhält keinen Wert! Ich weiß nicht, wie man das ArrayAC (i) in der DD-Variable speichert, die später im Excel-Blatt gedruckt wird. Danke,
Was ist 'DD', deklarieren Sie es nicht im Code Sie habe zur Verfügung gestellt. Die Zuweisung: 'DD = arrayAC (i)' - hast du einen Haltepunkt in diese Zeile gesetzt, um zu sehen, ob er getroffen wird? –
Ich nahm an, dass: Dim DD Als Datum – Zapata
Mein Fehler habe ich zuerst nicht gesehen. Hast du noch debuggen? –