Determine the first non-empty column

pepsister -  
f894009 Posted messages 17417 Registration date   Status Member Last intervention   -
Hello,

I have a pivot table and I’m trying to determine the first non-empty column (excluding column A which contains the title).

I tried the following formula:
Colonne = Cells(Ligne, 2).End(xlToLeft).Column

but it always returns 1, i.e., the first column. It’s as if I can’t move to column 2, it doesn’t respect my parameters in Cells.

How can I do this? I also tried with a Range("C2"), for example, but it’s the same, it returns Colonne=1.

Thank you for your help.

1 answer

  1. f894009 Posted messages 17417 Registration date   Status Member Last intervention   1 717
     
    Hello,
    If I’m not mistaken:
    Left: left
    Right: Right

    So to the left of A, nothing result 1
    But to the right of A, there is something over there

    Colonne = Cells(Ligne, 2).End(xlToRight).Column 
    1