View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Kevin B Kevin B is offline
external usenet poster
 
Posts: 1,316
Default What is wrong with this vba piece of code?

You've declared a range variable but did not assign it a range

Use something like this, substituting the correct range where I have
"Cell_Address_Here_As_String":

Set SCell = Range("Cell_Address_Here_As_String")
--
Kevin Backmann


"Jo" wrote:

Hi,

I am getting this error: "Object variable or With block variable is
not set!" Here is the mcro's code:

Sub Solve()

Dim SCell As Range

Do Until SCell.Value = 1
If SCell.Value < 1 Then
Range("J24").Select
Calculate
End If
Loop
End Sub

Thanks,
Jo