Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel auto increment formula in data table capturing additional rows

Posted on 2014-04-28
7
Medium Priority
?
918 Views
Last Modified: 2014-04-28
Two issues in this mockup file:

The formula in Column B is designed to auto populate the incremental count of each work order in Column A.  (e.g., if Column A has 3 work orders with the same #, show 1, 2, 3).  Right now it's jumping to the end of the data table and providing the total count vs. incremental count.

My change event macro works for the most part but I can't get it to completely unfilter if Cell E1 is blank.

More detailed notes in file.

Thank you, Experts!!!
Count-Test.xlsm
0
Comment
Question by:xllvr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 2000 total points
ID: 40027807
I cannot reproduce your first scenario. Please tell me the steps which lead to it.

For the second problem try

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    ActiveSheet.AutoFilterMode = False
    If Trim(Range("E1").Text) = "" Then
        Range("DATATABLE").AutoFilter Field:=1
    Else
        Range("DATATABLE").AutoFilter Field:=1, Criteria1:="=" & Range("E1").Text
    End If

End Sub
0
 
LVL 1

Author Comment

by:xllvr
ID: 40027847
Beautiful solution to the macro.  Thank you so much!

In terms of the first issue, it happens if I try to add two work orders of the same number, one right after the other, underneath the table.  For example, I am in the row directly underneath the data table, I add 500 for example.  The table dynamically expands to include it and the formula in Column B works just fine.  If I add 500 underneath a 2nd time, that's where the problem arises.  It will change the result in Column B in the row above to include all the rows in its formula.  

I hope that helps describe the issue I'm having.  Thank you again for your time and expertise in helping solve the problem!
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 40028112
I am unable to reproduce your problem.

I corrected the formulas in rows 19, 20 and 21. Then I entered 500 in A22 then in A23 then in A24. The formulas updated just as expected.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 1

Author Comment

by:xllvr
ID: 40028156
That is so odd.  So you were able to achieve the numbers 7, 8 and 9 in Column B starting in Row 22?   I don't understand why I'm having a different experience where it is showing 9, 9, 8, 9 starting in Row 21 (after adding 22 through 24).

If you have no idea why that would be happening, I'll close this question out.  Thanks!
Count-Test.xlsm
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 40028325
It beats me.

What version of excel do you have?
0
 
LVL 1

Author Comment

by:xllvr
ID: 40028346
I'm using 2010.  It really doesn't make sense to me.  Table mode is typically very reliable.  My only workaround which isn't very elegant is to have a macro that copies the formula down from the first cell all over again.  It works but feels pretty amateur unfortunately.

Thank you for your input and time!
0
 
LVL 1

Author Closing Comment

by:xllvr
ID: 40028348
Very helpful!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

618 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