What am I doing wrong

  • Thread starter Thread starter Fan924
  • Start date Start date
F

Fan924

Sub error()
Dim RowNumber As Double
Dim SecondDig As Double
RowNumber = Range("E386").Value 'Read RowNumber #
RowNumber = RowNumber - 4096 'Shift the RowNumber value
Range("H386").Value = RowNumber 'Print to make sure it worked
SecondDig = Range(RowNumber, 3).Value ' I get an error here
' using RowNumber as the row value
Range("I386").Value = SecondDig
End Sub

I get an error message on line 7. I am using a variable as the roe
number. What am I doing wrong?
 
Need to know what the rownumber is that you are trying to address. You
subtracted 4096 from it. Are you sure that you did not finish up with a
negative number so that you are trying to address a row off the top of the
sheet.

Check what value you have in cell H386 where you save rownumber.

Regard,

OssieMac
 
Hi again,

The light just come on. Your syntax is wrong.

try this:-

SecondDig = Cells(rownumber, 3).Value

Regards,

OssieMac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top