excel vba

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

TrustPilot

starstarstarstarstar Excellent

  • Home
  • Courses
  • Promotions
  • Schedule
  • Formats
  • Our Clients

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Excel VBA

Excel VBA

resolvedResolved · 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

Excel VBA

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

RE: Excel VBA

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 quickly

If you want to do a formula using the paste functions box press SHIFT + F3.

View all Excel hints and tips


Server loaded in 0.07 secs.