Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Range Definition in Macro ?

Hi,
Take this formula below...
VLOOKUP($F2,Calculations!$C$2:$C$25000,3,FALSE))

Now, I want "$25000" to be defined as a Range in a Macro. I have my raw data
varying from 1000 to 30000 everyday. If use this above formula, Excel
calculates for a long long time.

Instead I want to define a range in the macro and use that Range Name in
this formula.
One more thing, Range should have only the Row number (ex: 25000) and not
the column index (A, B...)

Ideally I want my formula to look like...
VLOOKUP($F2,Calculations!$A$2:$C RangeName,3,FALSE))

I know this syntax is wrong...

Is there a method?
--
Thanks
Baapi
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Range Definition in Macro ?

Try:

Dim eRow As Long
eRow = Sheets("Calculations").Cells(Rows.Count, 3).End(xlUp).Row
ActiveCell.Formula = "=VLOOKUP(F2,Calculations!$A$2:$C$" _
& eRow & ",3,FALSE)"


Hope this helps
Rowan

Baapi wrote:
Hi,
Take this formula below...
VLOOKUP($F2,Calculations!$C$2:$C$25000,3,FALSE))

Now, I want "$25000" to be defined as a Range in a Macro. I have my raw data
varying from 1000 to 30000 everyday. If use this above formula, Excel
calculates for a long long time.

Instead I want to define a range in the macro and use that Range Name in
this formula.
One more thing, Range should have only the Row number (ex: 25000) and not
the column index (A, B...)

Ideally I want my formula to look like...
VLOOKUP($F2,Calculations!$A$2:$C RangeName,3,FALSE))

I know this syntax is wrong...

Is there a method?

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
VBA Range definition: Code needed David B Excel Discussion (Misc queries) 8 September 25th 06 06:40 PM
Range definition problem Peter Chatterton[_2_] Excel Programming 6 November 18th 04 08:05 PM
How come this range definition is invalid? keepITcool Excel Programming 1 June 21st 04 07:15 PM
variable range definition jmp Excel Programming 2 May 6th 04 11:06 PM
Using Cells( ) for Range definition [email protected] Excel Programming 5 September 2nd 03 08:04 PM


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