WindsorKnot
Board Regular
- Joined
- Jan 4, 2009
- Messages
- 160
Hi,
I'm getting an error in my code below.
I basically want to determine if the values in column F on the "50000 sheet are > 50000 and if so to copy them into the "Storage" sheet in column A and loop until finished
The error is highlighted in red below- Object Variable or with Block Variable not set
I'm getting an error in my code below.
I basically want to determine if the values in column F on the "50000 sheet are > 50000 and if so to copy them into the "Storage" sheet in column A and loop until finished
The error is highlighted in red below- Object Variable or with Block Variable not set
Code:
Sub GetValue2()
Dim I As Integer
Dim Spcell As Range
I = 2
Dim R As Worksheet
Set R = Sheets("50000")
Do Until R.Range("F1").Value = "Total"
[COLOR=red]If Spcell.SpecialCells(xlCellTypeConstants, xlValues) > 50000 Then[/COLOR]
Sheets("storage").Cells(I, 1).Value = Spcell.Value
End If
I = I + 1
Loop
End Sub