+ Reply to Thread
Results 1 to 3 of 3

Count filtered data in VBA referencing multiple columns in a table

  1. #1
    Registered User
    Join Date
    09-03-2013
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2010
    Posts
    19

    Question Count filtered data in VBA referencing multiple columns in a table

    Hello again. I am having a hard time figuring out my problem. I hope I can explain it well. Basically I am trying to set my integer to count filtered data in a table. I have 7 columns of almost the same data that I want it to look at looping through each one. Ex. columns: Level 1 Manager, Level 2 Manager, ...., Level 7 Manager. I tried this code hoping for something but it is giving me a Compile Error: Sub or Function not defined on the first ROW statement.
    Example code
    Please Login or Register  to view this content.
    I had a countif in there previously before I found out that the Countif counted all data including the unfiltered data. I have x = 1.
    I want to say IF mgr >0 Then... Else End IF
    Also, I want it to reference the name that is selected from a drop down cell on another tab (that is where the "Sheets("Report").Range("Manager") comes from. I am not sure this is possible but I know there are some extreemly smart people here that can give me some kind of direction.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Count filtered data in VBA referencing multiple columns in a table

    First, the Syntax is Rows(), but inside the parenthesis needs to be a whole, greater than zero number, not a range object like you are trying to use.

    That being said, you really should post an example workbook showing what you are trying to achieve.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    09-03-2013
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Count filtered data in VBA referencing multiple columns in a table

    Ok attached is a sample workbook. On the Report page, Generate List is supposed to paste data from the data page of certain columns of whoever is labeled in the Select Manager drop down. My problem is when it is filtering, the mgr= integer is counting all data in the column and not just the filtered like I need it too. I need it to loop through each Level "*" column and paste on the Report tab.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 08-19-2015, 07:46 PM
  2. Referencing a cell to count multiple columns in another sheet
    By sh55174 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-06-2014, 10:08 PM
  3. Multiple filtered columns in a pivot table
    By JoWales in forum Excel General
    Replies: 1
    Last Post: 10-25-2011, 09:17 AM
  4. Pivot Table - Count data From Multiple Columns
    By Ashraf1 in forum Excel General
    Replies: 21
    Last Post: 02-23-2011, 08:13 AM
  5. Count in filtered list and display results in table on right of data
    By raydaw in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-27-2009, 05:14 AM
  6. Replies: 2
    Last Post: 06-23-2008, 09:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1