Hello, when I run the below code I get: Run Time Error 6: Overflow Error
Any idea on why this is happening?
Thanks!
Any idea on why this is happening?
Thanks!
VBA Code:
Sub CopyNumber()
Dim rownum As Long
Dim sht As Worksheet
Dim myval As Long
Set sht = ActiveSheet
rownum = 1
Do Until rownum = sht.Cells(sht.Rows.Count, "T").End(xlUp).row + 1
If IsNumeric(sht.Range("T" & rownum)) = True Then
myval = Range("T" & rownum)
rownum2 = rownum
If sht.Range("K" & rownum2) = "PA" Then
Do Until sht.Range("I" & rownum2) = "Name No.:"
rownum2 = rownum2 + 1
Loop
sht.Range("X" & rownum2) = myval
End If
End If
rownum = rownum + 1
Loop
End Sub