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: 42
Default sending parameter of another cell value

currently am using code:

Dim intMaterial As Integer
Dim strMaterial As String
strMaterial = ActiveCell.Offset([0], [-15])
intMaterial = ConvertMaterial(strMaterial)

the above works, but was going to try to reduce by two lines to:

Dim intMaterial As Integer
intMaterial = ConvertMaterial(ActiveCell.Offset(0, -15)) 'runtime error
1004 object defined error
-or-
Dim intMaterial As Integer
intMaterial = ConvertMaterial(ActiveCell.Offset(0, -15).Address(0,0))
'returns cell reference, not value
-or-
Dim intMaterial As Integer
intMaterial = ConvertMaterial(ActiveCell.Offset(0, -15).value) 'runtime
error 1004 object defined error

ConvertMaterial is my own function that takes in a string and returns an int.
Any ideas how to do this? thanx
 
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 use a cell value as a parameter Richhall[_2_] Excel Worksheet Functions 5 January 6th 08 05:02 PM
How to choose if I use a parameter or not in a parameter query Arnaud Excel Discussion (Misc queries) 0 March 8th 07 01:19 PM
Sending the current row number as a parameter to a function [email protected] Excel Programming 8 September 20th 06 03:41 AM
Sending a parameter to a Userform Dave Scott[_2_] Excel Programming 4 July 18th 06 04:47 AM
Format when sending a range as parameter to a custom function George Furnell Excel Programming 2 December 1st 05 05:22 PM


All times are GMT +1. The time now is 01:38 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"