Number each row in Excel 2007 spreadsheet using VBA
Posted on 2015-02-06
I have an Excel template where the end user enters a "po number" the template then brings in the records for that po number starting in cell B8 and across to J8. Sometimes there may be 3 records pulled, other times 50, there is no way of knowing how many records are brought in.
I want to be able to number each row (starting with cell A8) that is brought in. For example, if 3 records are brought in, then I would like to put 1, 2, 3 in column A. If there are 50 records, then insert 1 - 50 in column A.
How can I do this using VBA?
Thank you in advance.