Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Match and Range Reference Syntax

This syntax works fine,
Rng = Application.Match("Grand Total", .Range("A2:A100"), 0)
..
However, I would rather replace the fixed Range("A2:A100") with a
formula that would
incorporate, if acceptable, the Cells(Rows.Count, 1).End(xlUp).Row
Something like :
Rng = Application.Match("Grand Total", .Range("A2:A" &
Cells(Rows.Count, 1)._
End(xlUp).Row), 0)
..
....but my syntax fails.
Help appreciated.
J.P.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Match and Range Reference Syntax

Try this:

Rng = Application.Match("Grand Total", .Range("A2", _
.Range("A" & Rows.Count).End(xlUp)), 0)

Regards,
Per

On 19 Okt., 02:51, u473 wrote:
This syntax works fine,
Rng = Application.Match("Grand Total", .Range("A2:A100"), 0)
.
However, I would rather replace the fixed Range("A2:A100") with a
formula that would
incorporate, if acceptable, the Cells(Rows.Count, 1).End(xlUp).Row
Something like :
Rng = Application.Match("Grand Total", .Range("A2:A" &
Cells(Rows.Count, 1)._
* * * * * End(xlUp).Row), 0)
.
...but my syntax fails.
Help appreciated.
J.P.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default Match and Range Reference Syntax

Make sure you qualify your ranges (including cells() and rows).

Rng = Application.Match("Grand Total", _
.Range("A2:A" & .Cells(.Rows.Count, 1).End(xlUp).Row), 0)






On 10/18/2010 19:51, u473 wrote:
This syntax works fine,
Rng = Application.Match("Grand Total", .Range("A2:A100"), 0)
.
However, I would rather replace the fixed Range("A2:A100") with a
formula that would
incorporate, if acceptable, the Cells(Rows.Count, 1).End(xlUp).Row
Something like :
Rng = Application.Match("Grand Total", .Range("A2:A"&
Cells(Rows.Count, 1)._
End(xlUp).Row), 0)
.
...but my syntax fails.
Help appreciated.
J.P.


--
Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Match and Range Reference Syntax

Thank you both.
Have a good day,
J.P.
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
Syntax to match sheet by codename ker_01 Excel Programming 4 March 25th 10 04:55 PM
LOOKUP & MATCH syntax ?? Bassman62 Excel Worksheet Functions 6 April 8th 09 05:22 AM
Excel Match value_lookup asterisk syntax Jason Excel Worksheet Functions 1 May 24th 05 08:19 PM
Syntax for Range Reference Ken Excel Programming 1 December 8th 04 05:15 PM
Syntax for WorksheetFunction Match Hardy[_3_] Excel Programming 1 June 4th 04 11:33 AM


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