Hi all,
I am working with excel 2013 and vba. I have created a form to utilize for entering data into a list that I am in need of some assistance with. The form itself works just fine I am just trying to add another little feature to it. What I am trying to accomplish is when the workbook is opened and the form opens there is a field that is automatically populated with the next sequential number. Or at least assign a number to that row to be filled.
I have tried the following code, but get an error of "type mismatch"
Dim k, i As Long, n As Long
With Range("a12:d" & Range("a" & Rows.Count).End(xlUp).Row)
k = .Value
For i = 1 To UBound(k, 1) <--------line I get "Type mismathch"
If Len(k(i, 1)) = 0 Then
n = n + 1
k(i, 1) = n
End If
Next
.Value = k
End With
Any help would be great. Thank you in advance.
Red1976
Bookmarks