Solved

VBA Look not working correctly in Excel

Posted on 2014-03-04
2
242 Views
Last Modified: 2014-03-04
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
0
Comment
Question by:KP_SoCal
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39903097
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
0
 

Author Closing Comment

by:KP_SoCal
ID: 39905240
Excellent!  Thanks so much for your help!!
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question