zoom38
05-03-2022, 04:48 PM
Good evening,
I have a chart on a spreadsheet in which I have 5 columns (G17:G42), (I17:I42), (K17:K41), (M17:M42), (O17:O42) that I want to populate. I am able to populate them from top to bottom, over to the right, top to bottom, over to the right, top to bottom and so on. What I am trying to do is now is populate the chart from bottom to top, over to the left, bottom to top, over to the left and so on.
This is a snippet of the code I am using to do it from top to bottom (first column) which works
For Each m In Range("$G$17:$G$42")
LastEntry = "Empty"
If m.Value = "" Then
Exit For
Else
LastEntry = "Full"
End If
Next m
I cannot figure out how to modify it to go bottom to top. I've tried to modify it multiple ways but can't figure it out.
Attached is a shortened spreadsheet with what I'm doing. Sheet 1 is the bottom to top routine I can't figure out. Sheet 2 is the top to bottom routine that works.
Thank you in advance.
Gary
I have a chart on a spreadsheet in which I have 5 columns (G17:G42), (I17:I42), (K17:K41), (M17:M42), (O17:O42) that I want to populate. I am able to populate them from top to bottom, over to the right, top to bottom, over to the right, top to bottom and so on. What I am trying to do is now is populate the chart from bottom to top, over to the left, bottom to top, over to the left and so on.
This is a snippet of the code I am using to do it from top to bottom (first column) which works
For Each m In Range("$G$17:$G$42")
LastEntry = "Empty"
If m.Value = "" Then
Exit For
Else
LastEntry = "Full"
End If
Next m
I cannot figure out how to modify it to go bottom to top. I've tried to modify it multiple ways but can't figure it out.
Attached is a shortened spreadsheet with what I'm doing. Sheet 1 is the bottom to top routine I can't figure out. Sheet 2 is the top to bottom routine that works.
Thank you in advance.
Gary