Formerly Best Training
© 2024 STL. All Rights Reserved.
All prices offered for business users and exclude VAT. E&OE
2nd Floor, CA House, 1 Northey Street, Limehouse Basin, London, E14 8BT. United Kingdom
Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Excel VBA
Resolved · Low Priority · Version 2003
Raman has attended:
Excel Introduction course
Excel Intermediate course
Excel Advanced course
Excel VBA Intro Intermediate course
Excel VBA Intro Intermediate course
Hi, I have a query on writing SumIf & VLookups code, where the starting point of Data is know, but number of rows could vary for e.g. Number of rows could vary between 15 and 20.
VLookups:
Is it possible to set a dynamic Table Array, where starting point is know but number of rows could vary. I tried using CurrentRegion, but got an error.
SumIfs:
If starting points of Range (with Criteria) and Sum range are known but rows could vary. Would using the code below work:
Range with Criteria:
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range with Criteria:
Range("C2").Select
Range(Selection, Selection.End(xlDown)).Select
Would CurrentRegion.Rows work?
Regards,
Raman
Hi Ramon, thanks for your query. You are on the right track! Dynamic Named Ranges are extremely useful when you have a fluctuating amount of data but rather difficult to explain simple on this forum. Here is a link to a walkthrough and prepare to get to know the OFFSET function very well...
http://www.ozgrid.com/Excel/DynamicRanges.htm
Hope this helps,
Anthony
Tue 10 May 2011: Automatically marked as resolved.
|
Excel tip:Paste functions box quicklyIf you want to do a formula using the paste functions box press SHIFT + F3. |
We'll call during UK business hours
Server loaded in 0.07 secs.