I have a macro that I use to highlight lines of lists to see what stage I am at. It is pretty simple. It selects the current line and selects the next line.
Sub Highlight_Next_Row_Down() Selection.EndKey Unit:=wdLine Selection.HomeKey Unit:=wdLine, Extend:=wdExtend Selection.Range.HighlightColorIndex = wdNoHighlight Selection.MoveDown Unit:=wdLine, Count:=1 Selection.EndKey Unit:=wdLine Selection.HomeKey Unit:=wdLine, Extend:=wdExtend Selection.Range.HighlightColorIndex = wdYellow End Sub
Now I want it to just highlight the current line when I am on the last line of the document, because then I am finished. I would do this by inserting an if statement around all of this (minus the auxiliary statements), which first checks if this is the last line. But I do not know how to check if a line is the last line. I googled and found nothing.
Similarly, I have "Highlight_Next_Row_Up" and I want to know how to do the same when I reach the top line.
Thanks for any help
source share