View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Trouble getting the value of a cell

M.,

Range only accepts A1 style references. So you could use:

strOffset = "C" & intColNo
intDayDiff = Worksheets(strMstSht).Range(strOffset).Value

Or, you could use the .Cells object, which takes row and column numbers:

intDayDiff = Worksheets(strMstSht).Cells(intColNo, 3).Value


HTH,
Bernie
MS Excel MVP


"SHIPP" wrote in message
...
I use a formula to obtain the row of the value I am seeking to obtain

which
is in a different worksheet than the one I am working in. I am trying to

use
the following

strOffset = "R" & Trim(Str(intColNo)) & "C3"
intDayDiff = Worksheets(strMstSht).Range(strOffset).Value

strOffset does contain the correct column # and returns R7C3. However I

get
an error in the intDayDiff line. Any help would be appreciated.
--
M. Shipp