Results 1 to 14 of 14

Loop through a data validations list and for each loop count the number of occurences

Threaded View

waimea Loop through a data... 07-03-2018, 11:20 AM
waimea Re: Loop through a data... 07-03-2018, 11:30 AM
waimea Re: Loop through a data... 07-03-2018, 11:39 AM
waimea Re: Loop through a data... 07-03-2018, 05:25 PM
Marc L Re: Loop through a data... 07-03-2018, 06:31 PM
waimea Re: Loop through a data... 07-03-2018, 06:35 PM
Marc L Re: Loop through a data... 07-03-2018, 06:39 PM
waimea Re: Loop through a data... 07-03-2018, 06:48 PM
waimea Re: Loop through a data... 07-04-2018, 06:22 AM
waimea Re: Loop through a data... 07-05-2018, 05:52 AM
Marc L Re: Loop through a data... 07-05-2018, 06:02 AM
dominicb Re: Loop through a data... 07-05-2018, 07:31 AM
waimea Re: Loop through a data... 07-06-2018, 06:48 AM
waimea Re: Loop through a data... 07-08-2018, 05:22 AM
  1. #1
    Forum Contributor
    Join Date
    06-30-2018
    Location
    Sweden
    MS-Off Ver
    2016.
    Posts
    397

    Loop through a data validations list and for each loop count the number of occurences

    I have cross-posted this at https://stackoverflow.com/questions/...lidation-lists and on https://www.mrexcel.com/forum/excel-...ion-lists.html

    I am trying to loop through 2 pairs of data validation lists, 4 data validation drop downs in total.

    With every loop of the data validation lists I would like to count the number of occurrences of two symbols and

    then save the result of each loop in a variable or a worksheet or both.

    I have found a bit of code that I think could be a starting point to work from.

    Sub dataValidationAllSheet()
    
    Dim sh As Worksheet
    Dim cell As Range
    
    ' Loop through all sheets
    
    For Each sh In ThisWorkbook.Worksheets
        'Loop through all cells with validation
        For Each cell In sh.Cells.SpecialCells(xlCellTypeAllValidation)
            'Print cell address, validation type and cell parent name to immediate window
            Debug.Print cell.Address & vbTab & cell.Validation.Type & vbTab & cell.Parent.Name
        Next cell
    Next sh
    
    End Sub
    Last edited by waimea; 07-05-2018 at 12:14 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Loop through list, add to Array, count number of occurrences, clear array
    By HalPlz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-11-2016, 09:42 PM
  2. [SOLVED] VBA loop to copy a worksheet a number of times, assign name each time based on loop number
    By TBG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2012, 10:54 PM
  3. [SOLVED] Count number of occurrences for a number of ranges from a find loop
    By ANDREWA in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-23-2012, 07:53 PM
  4. Do-While loop within a do-while loop? Dealing with changing number of rows
    By Motox in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-02-2012, 12:59 AM
  5. VBA For loop where number of iterations can be changed from inside loop
    By barrboy89 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-11-2011, 12:18 PM
  6. Loop (Number Count)
    By PRodgers in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 06-19-2009, 05:56 PM
  7. How to count number of occurences in an autofilter list
    By sho in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-16-2005, 08:06 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