Solved

VBA Look not working correctly in Excel

Posted on 2014-03-04
2
237 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 48

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now