I need to find the number of rows in a column of Excel and minus one of the total rows. And assign this numeric value to variable. Example: Column A has data in 10 rows. Now using VBA script I should be able to find the total number of rows. Total rows in column A is 10. Then total minus 1. 10-1=9 And this 9 has to be assigned to a variable and shd be written in the excel sheet. X is 9 . The x value is 9 and it should get stored in column B as 009.
Suppose if X value is 38, it should get stored as 038 in column B
Please suggest the best possible way.