Hello, I have a spreadsheet that I am trying to finish this morning and for some reason I can't get the Input box to work. My macro scans through code and filters data based on whether it is greater than a number, less than a number or the change between cells to the left of the selected cell is greater than a number.
I have added a couple lines of code to prompt the user to select the active cell but for some reason I am getting error code 424 Object required after I select the active cell.
Your help would be greatly appreciated!
I have added a couple lines of code to prompt the user to select the active cell but for some reason I am getting error code 424 Object required after I select the active cell.
Your help would be greatly appreciated!
Code:
Sub mypicker()
Dim rng As Variant
rng = Application.InputBox("Select the first velocity data point that you would like to filter", Type:=8)
If rng = False Then Exit Sub
rownow = rng.Row
columnnow = rng.Column
newrow = 9
newcolumn = 1
mytime = 0
While Cells(rownow, columnnow).Value <> ""
If Cells(rownow, columnnow).Value > 18 Or Cells(rownow, columnnow).Value <= 0 Or Abs(Cells(rownow + 1, columnnow - 1) - Cells(rownow, columnnow - 1)) > 0.2 Then
mya = myb
Else
Cells(newrow, newcolumn).Value = mytime
Cells(newrow, newcolumn + 1).Value = Cells(rownow, columnnow - 1).Value
Cells(newrow, newcolumn + 4).Value = Cells(rownow, columnnow).Value
newrow = newrow + 1
End If
rownow = rownow + 1
mytime = mytime + 1
Wend
End Sub