Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
I have added them for you this time
This code might be what you want
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim MaxRow As Long
Dim MaxNum As Long
MaxRow = ActiveSheet.UsedRange.Rows.Count
If Target.Row = MaxRow + 1 Then MaxNum = _
Application.WorksheetFunction.Max(Range(Cells(1, 1), Cells(MaxRow, 1))) + 1
Cells(Target.Row, 1) = MaxNum
End Sub
Copy the code
Select the worksheet in which you want the code to run
Right click on the sheet tab and choose View Code, to open the Visual Basic Editor.
Where the cursor is flashing, choose Edit | Paste
Bookmarks