Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Problems passing parameters to OFFSET, probably a simple fix for theexperienced Excel programer

Excel 2003 (11.8211.8202) SP3
Microsoft Windows XP Professional Service pack 2
New to Excell programming.

I wrote a function that allows me to pass in a row and column to be
used to access a table.
When I run the code the two variables 'r' & 'c' have the correct
values r1 = 1 and c1 = 1 but the OFFSET operation always evaluates to
r1= 0 and c1 = 0.

I even tried hardcoding r1 and c1 but they seem to evaluate to 0,0
even though the debugger indicates they are have the correct values
r1 = 1 and c1 = 1...

I am thinking that the syntax is wrong for passing in the parameters
for row and column into the OFFSET function,
Any help would be greatly appreciated. - mike

Function GET_WEIGHT(row, column)
Dim r1 As Long 'Variant
Dim c1 As Long

r1 = 1 'hardcoded
c1 = 1 'hardcoded

GET_WEIGHT = [=OFFSET(CRITERIA_WEIGHT_TABLE_2, 2, 2, 1, 1)]
GET_WEIGHT = [=OFFSET(CRITERIA_WEIGHT_TABLE_2, r1, c1, 1, 1)]
End Function
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Problems passing parameters to OFFSET, probably a simple fix forthe experienced Excel programer

On Mar 25, 9:58*am, mike wrote:
Excel 2003 (11.8211.8202) SP3
Microsoft Windows XP Professional Service pack 2
New to Excell programming.

I wrote a function that allows me to pass in a row and column to be
used to access a table.
When I run the code the two variables 'r' & 'c' have the correct
values r1 = 1 and c1 = 1 but the OFFSET operation always evaluates to
r1= 0 and c1 = 0.

I even tried hardcoding r1 and c1 but they seem to evaluate to 0,0
even though the debugger indicates they are *have the correct values
r1 = 1 and c1 = 1...

I am thinking that the syntax is wrong for passing in the parameters
for row and column into the OFFSET function,
Any help would be greatly appreciated. *- mike

Function GET_WEIGHT(row, column)
* Dim r1 As Long *'Variant
* Dim c1 As Long

* r1 = 1 * *'hardcoded
* c1 = 1 * 'hardcoded

* GET_WEIGHT = [=OFFSET(CRITERIA_WEIGHT_TABLE_2, 2, 2, 1, 1)] <- This works fine
* GET_WEIGHT = [=OFFSET(CRITERIA_WEIGHT_TABLE_2, r1, c1, 1, 1)] <- This allways makes r1 and c1 = 0 when they really = 1


End Function


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
Excel VBA Passing Parameters Through Cell Diana[_7_] Excel Programming 4 April 4th 07 05:53 AM
Passing Parameters to Word from Excel jake1729 Excel Programming 0 September 28th 05 12:47 AM
Passing parameters from excel to access Jabeen Excel Programming 2 April 5th 05 12:33 PM
Passing Excel Objects As Parameters Jake Marx[_3_] Excel Programming 0 September 17th 04 04:25 PM
Passing Excel Objects As Parameters MDW Excel Programming 0 September 17th 04 04:17 PM


All times are GMT +1. The time now is 11:36 AM.

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

About Us

"It's about Microsoft Excel"