I am working on a project (that should be simple) but I cannot get it to work. All I need it to do is to loop through a range of cells that will always start in cell D2 but will have a different ending row count every week and look for any cell that shows #N/A (from a previous vlookup formula) - then show an input box, we input the correct ID# which gets put into the cell instead, and move onto the next cell until there are no more cells. I have tried various ways of doing this and the inputbox part works (i.e. if I have #N/A in the first cell it completes what I want it to do) but it never moves on to the other cells.... please help! Here is my code at the moment (this is just an excerpt so I copied all my variable declarations even what I don't use)...
Sub Team3Test()
Dim NewSheet As String
Dim c As Range
Dim i As Long
Dim TestRange As Range
Dim cell As Range
Dim b As Range
Dim Employee As String
Dim SSID As Long
Dim NumRows As Integer
Dim myrange As Range
Set b = Range("D2")
NumRows = Range("D2", Range("D2").End(xlDown)).Rows.Count
Set myrange = Range("D2:D" & NumRows)
For Each b In myrange
If Application.IsNA(ActiveCell.Value) Then
Employee = ActiveCell.Offset(0, -3).Value
SSID = InputBox("Please enter the Staffsuite ID# for " & Employee & " :", "New Employee Found")
ActiveCell.Value = SSID
End If
Next
End Sub
Bookmarks