Announcement

Collapse
No announcement yet.

Using Countif in VBA with dynamic Column references

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Countif in VBA with dynamic Column references



    Hi,

    I can't believe nobody has had this issue before but i cant find it on the web.

    I have a table with 6 columns. In the 5th column i want to add a formula which says: check how many columns there are after column 6 (F) and then do a countif if any of them say "x".


    i cannot figure this out. I know it should be simple but its got me stumped. Please help.

    thanks

  • #2
    Hi hillmas it would be easier to visualise if you posted a sample workbook
    If the solution helped please donate to RSPCA

    Sites worth visiting: Rabbitohs | Excel-it royUK | Excel Matters Rory | Kris' Spreadsheet Solutions | Domenic xl-central | The Smallman

    Comment


    • #3


      Assuming the formula is in E2 then

      =COUNTIF(G2:XFD2,"x")
      Hope that Helps

      Roy

      New users should read the Forum Rules before posting

      For free Excel tools & articles visit my web site

      RoyUK's Web Site

      royUK's Database Form

      Where to paste code from the Forum

      About me.

      Comment

      Working...
      X