Results 1 to 4 of 4

VBA: Help with countifs / Match

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    VBA: Help with countifs / Match

    Hi,

    Summary: Need to find out Position (especially column ) of a certain value ( input will be through code or in cell) and pass it as a first parameter to Countifs function

    i have this ( headers)

    A1:City1 B1:City2 C1:City4 D1:City6 E1:City5.....and appropriate values under each header.

    ..and the user input is in A2:City4 ( example)

    i would need to find out the position of City ( primarily which column - here it would be column 3 or C) and then use this column as input to countifs to count the value.


    sub test
    value1=range("A2").value
    'HLUP is defined name for A1:E1
    Ymatch=Evaluate("=match(""" & value1 & """,HLUP,0)")
    y=evaluate("=countifs(column(Ymatch),"=10")
    msgbox y
    The parameter in Bold should be substitued suitably which should access the corresponding Column
    Last edited by vidyuthrajesh; 02-29-2012 at 02:01 PM. Reason: Fantastic !! Resolved...many thanks.

Thread Information

Users Browsing this Thread

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

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