StuFromSaturday
Board Regular
- Joined
- Nov 3, 2009
- Messages
- 81
Evening all, I wonder if someone could help me out with some VBA?
I have a situation that crops up all the time whereby I have a named range comprised of anything between 4 and 25 rows, and between 1 and unlimited columns (though usually no more than, say, 10). This range does not always begin in the first row or first column of the sheet. The first cell in the range ALWAYS contains the same string – this is not repeated anywhere else in the range. There is always a date in the first column of the range (though not always on the same number row within the range) in YYYYMMDD format.
Now.
I need to replicate this range, everything copied exactly as it is but with the date decreasing in value by one day each time, to the cell to the right of wherever the current range ends, over and over again to a starting date of the user’s choosing, backwards from that date I mentioned. The dates need to remain in the same format. And at the end, I need each of the replicated ranges, as well as the original, to be named as per the original, i.e. as if the user were to hold down CTRL and highlight them all individually where the start string occurs, and name the multiple selections with one range name.
This probably sounds a lot more confusing than it looks to me – however my VBA is appallingly (APPALLINGLY) rusty and I need to solve this fairly quickly….I've had a very half-hearted stab but can anyone help please???
Stu
I have a situation that crops up all the time whereby I have a named range comprised of anything between 4 and 25 rows, and between 1 and unlimited columns (though usually no more than, say, 10). This range does not always begin in the first row or first column of the sheet. The first cell in the range ALWAYS contains the same string – this is not repeated anywhere else in the range. There is always a date in the first column of the range (though not always on the same number row within the range) in YYYYMMDD format.
Now.
I need to replicate this range, everything copied exactly as it is but with the date decreasing in value by one day each time, to the cell to the right of wherever the current range ends, over and over again to a starting date of the user’s choosing, backwards from that date I mentioned. The dates need to remain in the same format. And at the end, I need each of the replicated ranges, as well as the original, to be named as per the original, i.e. as if the user were to hold down CTRL and highlight them all individually where the start string occurs, and name the multiple selections with one range name.
This probably sounds a lot more confusing than it looks to me – however my VBA is appallingly (APPALLINGLY) rusty and I need to solve this fairly quickly….I've had a very half-hearted stab but can anyone help please???
Stu