LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default out of range error for range value

Hi;

i'm trying to capture a value in a range. I have the following codeattched
to the click action on a button in my "Results" sheet:

Dim LastDataRow As Integer

LastDataRow = Worksheets("Data").Range("E1").Value

When the above line is reached, I get a "Run time error '9' Subscript out of
range" error message.

Cell E1 of the worksheet labelled "Data" has the value 9 in it. I tried
displaying the value of it by the line :

MsgBox Worksheets("Data").Range("E1").Value

which was placed just before the problem line. When the MsgBox line
executed, the value was blank in the message box.

I'm at a loss as to what the problem is. Any help is greatly appreciated.

--
JJFJR
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Type Mismatch error & subscript out of range error Jeff Wright[_2_] Excel Programming 3 May 14th 05 07:14 PM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
Adding named range gives error "method range of object _Global failed " Gunnar Johansson Excel Programming 3 August 10th 04 01:54 PM


All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"