Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Trouble getting the value of a cell

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Trouble getting the value of a cell

Range does not support R1C1 references.

I would suggest

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

but why would your row number be in a variable named intColNo?

--
Regards,
Tom Ogilvy

"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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Trouble getting the value of a cell

Thanks very much for everybodys help. In answer to your quesion I am creating
a schedule for the construction industry which takes into consideration
Saturdays, Sundays, and Holidays. I initially set-up a schedule based on days
between steps and days between homes. As the schedule progresses the user can
manually override the calculations. I then do a search backwards on the
schedule to find the first cell that is not a formula. From that point
forward I have to recalculate the workdays to eliminate Sat. Sun. and
Holidays. Because there is a direct relationship between the worksheets I am
able to determine which step and lot I am on and consequently the lead time
between activities.
--
M. Shipp


"Tom Ogilvy" wrote:

Range does not support R1C1 references.

I would suggest

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

but why would your row number be in a variable named intColNo?

--
Regards,
Tom Ogilvy

"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




  #4   Report Post  
Posted to microsoft.public.excel.programming
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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Trouble getting the value of a cell

Range does not use RC designations, Cells does. Try using something more like
this:

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

--
HTH...

Jim Thomlinson


"SHIPP" wrote:

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



Reply
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
Trouble in Dragging the cell Tim Leung Excel Worksheet Functions 3 September 2nd 08 06:27 PM
Trouble splitting cell contents scottr Excel Discussion (Misc queries) 2 April 17th 07 03:33 PM
Cell locking trouble Jeffery Tyree Excel Discussion (Misc queries) 4 November 22nd 05 05:27 PM
Cell locking trouble Jeffery Tyree New Users to Excel 2 November 22nd 05 05:26 PM
trouble with cell choice Mark[_17_] Excel Programming 0 September 16th 03 08:05 AM


All times are GMT +1. The time now is 02:20 AM.

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"