We help IT Professionals succeed at work.
Troubleshooting Question

For each row in a specific range, starting from the left, identify the column number that has a cell value greater than zero(0)

25 Views
Last Modified: 2020-10-21
For each row in a specific range, starting from the left, identify the column number that has a cell value greater than zero(0) for each row.

Comment
Watch Question

HainKurtSr. System Analyst
CERTIFIED EXPERT

Commented:
a tiny function

Function ixNZ(r)
  ixNZ = 0
  For Each c In r
    If c.Value > 0 Then
        ixNZ = c.Column
        Exit For
    End If
  Next
End Function

29198277.xlsm
Protect yourself and your loved ones. Stay home for the holidays.
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Martin LissProtect yourself and your loved ones. Stay home for the holidays.
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
I’m glad I was able to help.

If you expand the “Full Biography" section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange Most Valuable Expert (MVE) 2015, 2017
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2019
              Experts Exchange Top Expert VBA 2018, 2019
              Experts Exchange Distinguished Expert in Excel 2018