How do I create a loop that increments a variable until an empty cell is found? And once that cell is found, how do I get the variable to hold the row number of the next empty row?
How do I create a loop that increments a variable until an empty cell is found? And once that cell is found, how do I get the variable to hold the row number of the next empty row?
e.g.:
Please Login or Register to view this content.
Please Login or Register to view this content.
Please Login or Register to view this content.
thank you for these examples, if I wanted to start from the end of a sheet and work backwards to find the cell with content would I do something like this Cells(5, 1).End(xlUp).Row.Select?
Hello NVL,
You would use this...
F.Y.I. in VBA it is rare you will ever need to select an object before performing an operation on it. Selecting also slows your code code considerably.Please Login or Register to view this content.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
It depends on what is the "content", and you define the starting position of the loop, as Leith Ross shows or from some predetermined value, for example:
(the loop counter, of course, is reduced by some value)
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks