Solved

VBA Look not working correctly in Excel

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

808 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