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

STL - Formerly Best Training Solutions Through Learning
TrustPilot
Excellent
Request Callback We will call you back
0207 987 3777 Call for assistance
Your Basket Basket is empty
excel vba

ResolvedVersion 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:

Change Excel's default font

You can change the default font and font size for all spreadsheets created in Excel by:

1. Going to Tools on the menu bar.
2. Select Options, then General.
3. Next to Standard Font you can change the font and font size.
4. Click OK.

Each new file you start from this point onward should use the font and font size you have selected.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.