Below is a part of my code. The problem is that the first copied data is overwritten bij the next set of data.
Which code do I need to paste the second set of data below the first set. And the third set below the second one.
E.G. My first set of data is copied in range A2:A5. Then I want the next set of data copied in the range A6:A10.
Which code do I need to paste the second set of data below the first set. And the third set below the second one.
E.G. My first set of data is copied in range A2:A5. Then I want the next set of data copied in the range A6:A10.
VBA Code:
Set rngFilterCriteria = shtFilterCriteria.Range("E3:G4")
Set rngCopyToRange = shtArchiefMutaties.Range("A1:H1")
'Het bereik van de unieke lijst op het werkblad FilterCriteria
arrUniekeClient = shtFilterCriteria.Range("I4:I" & lngLastRowUniekeClient).Value
'In deze loop gebeurt het volgende:
'Het gehele bereik wordt meegenomen in de For i
For i = LBound(arrUniekeClient, 1) To UBound(arrUniekeClient, 1)
'De waarde van de unieke lijst wordt weggeschreven in cel G4
shtFilterCriteria.Range("G4").Value = arrUniekeClient(i, 1)
'De mutaties worden gearchiveerd.
'Het wegschrijven vindt plaats.
shtMutaties.Range("A6").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=rngFilterCriteria, _
CopyToRange:=rngCopyToRange