Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TROUBLE WRITING TO A CELL IN EXCEL

Status
Not open for further replies.

Jooky68

Programmer
Jul 10, 2002
231
US
I am attempting to write to a cell in excel. I have done this numerous times in this particular program that I am writing...but for some reason out of no where it says object out of range....


Sheets("CASEINPUTS").Select
If Cells(249, casenum + 2).Value <> 0 Then
Range(&quot;DBUSED&quot;).Value = Cells(249, casenum + 2)
Range(&quot;DBUSEDQUICK&quot;).Value = Cells(249, casenum + 2)
Range(&quot;CASEDATA&quot;).Value = Cells(248, casenum + 2)
Else
Range(&quot;DBUSED&quot;).Value = &quot;NONE&quot;
Range(&quot;DBUSEDQUICK&quot;).Value = &quot;NONE&quot;
End If
I am attempting to write to dbused and dbusedquick, but keeps coming with out of range for only dbusedquick??? any ideas what possibly could of went wrong?
 
the error is- method 'range' of objec '_worksheet' failed ..

to be exact.Any reply would be greatly appreciated
 
Hi,

Need to know a bit more of your code. What values does casenum use? Also what are the ranges of your named cells DBUSED,DBUSEDQUICK and CASEDATA i.e, C2:E500 etc?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top