I'm in the process of creating a macro, but there is a step which I'm stuck at. I have a macro that contains large lists
column A:Stock symbol, column B: ex-dividend date of each symbol, column C: dividend, column D:today's date, column E: matches between column's B and D (Date only), otherwise it lists 0's.
I chose to turn the dates into serial numbers and sort them from furthest off into the future to present. In column E there ends up being a list (all the same date) whose ex-div date matches tommorrow's date, after there are no more matches the rest of the column is zero's to the bottom of the list. This way I'm aware of all the symbols in my universe that pay a dividend the following day. I need help in the next column of code. I want there to be a loop in column F. In this loop I would like there to be an "if" condition such as =If(E2=B2, CONCATENATE(A2, "", C2, ""), "0"). I would like it to run this code until there is a zero column E (i.e. there are no more ex div dates that match my symbols). I'm thinking this would be loop such as
Dim somevariable AS variant
Dim somevariable As Integer
somevariable = .....
Do
....
Loop Until ActiveCell.Offset(0,-1) = 0
or soemthing like this. I can't figure it out though and need some help. Any help would be greatly appreciated thanks.
column A:Stock symbol, column B: ex-dividend date of each symbol, column C: dividend, column D:today's date, column E: matches between column's B and D (Date only), otherwise it lists 0's.
I chose to turn the dates into serial numbers and sort them from furthest off into the future to present. In column E there ends up being a list (all the same date) whose ex-div date matches tommorrow's date, after there are no more matches the rest of the column is zero's to the bottom of the list. This way I'm aware of all the symbols in my universe that pay a dividend the following day. I need help in the next column of code. I want there to be a loop in column F. In this loop I would like there to be an "if" condition such as =If(E2=B2, CONCATENATE(A2, "", C2, ""), "0"). I would like it to run this code until there is a zero column E (i.e. there are no more ex div dates that match my symbols). I'm thinking this would be loop such as
Dim somevariable AS variant
Dim somevariable As Integer
somevariable = .....
Do
....
Loop Until ActiveCell.Offset(0,-1) = 0
or soemthing like this. I can't figure it out though and need some help. Any help would be greatly appreciated thanks.