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: 7
Default Range as variable No.2

Hi All,

I'm working in excel97 VBA.
My aim is to "override" the original VLookup worksheet
function with my own function declarated below. In this
function I use "rng" and rng1 as Range variable, and I
would like to change the values in the range's first
column before working with it. (That's and others why
using new variable rng1 as Range.)

I can't explain, why doesn't it work at all if only I rem
the " 'rng1.Range("a1").Value = 2 " line.



Function fkeres1(ByVal cella, rng As Range, Optional i As
Long = 2, Optional logikai As Boolean = False)
Dim rng1 As Range

Set rng1 = rng
'rng1.Range("a1").Value = 2

fkeres1 = WorksheetFunction.VLookup(cella, rng, i, logikai)
End Function

 
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
Variable Range James C. Excel Discussion (Misc queries) 3 April 2nd 09 12:41 AM
from Range variable Marina Limeira Excel Discussion (Misc queries) 0 January 22nd 06 02:35 PM
setting a range variable equal to the value of a string variable Pilgrim Excel Programming 2 July 1st 04 11:32 PM
Variable Range Martin[_9_] Excel Programming 1 October 12th 03 05:09 PM
Problem trying to us a range variable as an array variable TBA[_2_] Excel Programming 4 September 27th 03 02:56 PM


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