The code above adds an autonumber from a form. However, I occasionally get a "Run-time error '13': Type mismatch" If I navigate away from the sheet this code refers to and then go back to it. As if it's not looking at the previous number and adding another.'Adds an Autonumber Dim LR As Long With Sheets("Sheet1") LR = .Range("A" & Rows.Count).End(xlUp).Row .Range("A" & LR + 1).Value = Range("A" & LR).Value + 1 End With
Can anyone see an issue with this bit of code or suggest another bit of code that will add an auto number by checking the previous number regardless of where I am in the workbook?
Hope that makes sense.
Bookmarks