View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default locate cell with specific text and select that column

First click on a cell in the row you want searched and then run:

Sub get_col()
s = "happiness"
n = ActiveCell.Row
For i = 1 To Columns.Count
If Cells(n, i).Value = s Then
Cells(n, i).EntireColumn.Select
End If
Next
End Sub

to find happiness.
--
Gary''s Student - gsnu200796