VBA code to count columns : how do i select the last column from second row and move the cursor one cell above.

For eg. if I am at cell A2, how do I make macro to count the number of columns starting from Row 2 and select the cell above it.