N
NewbieNerd
What is the best way to update an Excel worksheet which
has links to other worksheets using vlookup when the
number of rows of data to be returned vary? Is it
reasonable to think I can even do it in Excel?
In the past, I have generated data in one worksheet using
the vlookup function linked to other worksheets.
For example, for a one-page summary worksheet on loan
activity in a region:
1) The user selects a region from a list.
2) A macro copies the selected region into a specific cell.
3) The vlookup function in the summary worksheet gathers
information from linked workbooks based on the selected
region.
This has worked well, because the number of data elements
doesn't vary. One page, one region [summarized], same data
elements.
Now, however, I have a requested report that will involve
listing the counties in each region. So, the summary
worksheet will need only one line of information if there
is only one county in the region but seven lines of data
if there are seven counties. And the totals row would
need to total only one row if there is one region, but
seven rows if there are seven.
I did work for a little bit trying to code a macro to
handle it [I'm a Visual Basic newbie] but that appears to
be a clunky solution. [My thought was to create a macro to
clear a section of the worksheet and then copy in the
lookup formulas for the number of rows needed.]
Any suggestion on the best path to pursue will be greatly
appreciated. Thank you so much!
has links to other worksheets using vlookup when the
number of rows of data to be returned vary? Is it
reasonable to think I can even do it in Excel?
In the past, I have generated data in one worksheet using
the vlookup function linked to other worksheets.
For example, for a one-page summary worksheet on loan
activity in a region:
1) The user selects a region from a list.
2) A macro copies the selected region into a specific cell.
3) The vlookup function in the summary worksheet gathers
information from linked workbooks based on the selected
region.
This has worked well, because the number of data elements
doesn't vary. One page, one region [summarized], same data
elements.
Now, however, I have a requested report that will involve
listing the counties in each region. So, the summary
worksheet will need only one line of information if there
is only one county in the region but seven lines of data
if there are seven counties. And the totals row would
need to total only one row if there is one region, but
seven rows if there are seven.
I did work for a little bit trying to code a macro to
handle it [I'm a Visual Basic newbie] but that appears to
be a clunky solution. [My thought was to create a macro to
clear a section of the worksheet and then copy in the
lookup formulas for the number of rows needed.]
Any suggestion on the best path to pursue will be greatly
appreciated. Thank you so much!