VBA Look not working correctly in Excel

KP_SoCal
KP_SoCal used Ask the Experts™
on
If you open my attached file and click the [Update] button, you'll see I'm attempting to apply a sum below the last row of each table in a worksheet.

I'm using a defined name range so the procedure knows which worksheets to select.

The code is running like expected, but it's running 3 times.  I only want it to run once.  Any idea on what changes I need to make?  Thanks for you help!
Example-Sheet.xlsm
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
Hi,

Change

=dataDistricts!$A$2:INDEX(dataDistricts!$1:$50;MATCH("ZZZZZZZZZZZZ"; dataDistricts!$A:$A);3)

Open in new window

To

=dataDistricts!$A$2:INDEX(dataDistricts!$1:$50,MATCH("ZZZZZZZZZZZZ", dataDistricts!$A:$A),1)

Open in new window

EDIT

You are getting A2:C5 instead of A2:A5

Regards

Author

Commented:
Excellent!  Thanks so much for your help!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial