L Lena Apr 7, 2004 #1 How can i get the value of the rightmost or the leftmost cell from a specific row if the value is not empty ?? Thanks Lena
How can i get the value of the rightmost or the leftmost cell from a specific row if the value is not empty ?? Thanks Lena
F Frank Kabel Apr 7, 2004 #2 Hi Lena one way: Enter the following array formulas (entered with CTRL+SHIFT+ENTER): =INDEX(1:1,MAX(IF(1:1<>"",COLUMN(1:1)))) and =INDEX(1:1,MIN(IF(1:1<>"",COLUMN(1:1))))
Hi Lena one way: Enter the following array formulas (entered with CTRL+SHIFT+ENTER): =INDEX(1:1,MAX(IF(1:1<>"",COLUMN(1:1)))) and =INDEX(1:1,MIN(IF(1:1<>"",COLUMN(1:1))))
R RC- Apr 7, 2004 #3 Here's a start: Sub GetMyVal() Selection.End(xlToLeft).Select x = ActiveCell.Value Selection.End(xlToRight).Select y = ActiveCell.Value End Sub
Here's a start: Sub GetMyVal() Selection.End(xlToLeft).Select x = ActiveCell.Value Selection.End(xlToRight).Select y = ActiveCell.Value End Sub
J Jason Morin Apr 7, 2004 #4 To get the value furthest to the left in row 1: =INDEX(1:1,MIN(IF(1:1<>"",COLUMN(1:1)))) Array-entered (meaning press ctrl/shift/enter). Furthest to the right: =INDEX(1:1,MAX(IF(1:1<>"",COLUMN(1:1)))) Also array-entered. HTH Jason Atlanta, GA
To get the value furthest to the left in row 1: =INDEX(1:1,MIN(IF(1:1<>"",COLUMN(1:1)))) Array-entered (meaning press ctrl/shift/enter). Furthest to the right: =INDEX(1:1,MAX(IF(1:1<>"",COLUMN(1:1)))) Also array-entered. HTH Jason Atlanta, GA