I\'m new to VBA and can;t wrap my head around the most efficient way to do this - what I\'m looking for is a way to copy my data into rows below the active cell based upon a fre
You need a function that translate the frequency text to a number of months (let´s call it MonthFreq returning an integer).
This will do what you want:
MaxDate = DateSerial(2013, 4, 1)
Do Until Origin.Cells(OriginRow, NameColumn).Value = ""
SourceDate = Origin.Cells(OriginRow, DateColumn).Value
Do Until SourceDate >= MaxDate
' Copy origin row to destiny.
Destiny.Cells(DestinyRow, DateColumn).Value = SourceDate
SourceDate = DateAdd("m", MonthFreq(Origin.Cells(OriginRow, FreqColumn).Value), SourceDate)
DestinyRow = DestinyRow + 1
Loop
OriginRow = OriginRow + 1
Loop
Origin is the worksheet with the original data, Destiny is the worksheet where the expanded data will be saved. OriginRow is the current row being analyzed in the Origin worksheet (starts at the first row). OriginColumn is the current row being written in the Destiny worksheet (starts at the first row). SourceDate will be added some number of months until it reaches the MaxDate.