Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default locate cell with specific text and select that column

I need a macro that will search for a cell with specific text within a row
and then select its appropriate column. Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default locate cell with specific text and select that column

On Jul 30, 5:35*pm, rockytopfan4ever
wrote:
I need a macro that will search for a cell with specific text within a row
and then select its appropriate column. *Any ideas?


There are lot of ideas. First one is: why can't you put some serious
stuff and do it yourself? U just need to record the steps and then
play with the code in the macro as per your needs!!
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default locate cell with specific text and select that column

The macro recorder can be your friend. Recorded and cleaned up.

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/30/2008 by Donald B. Guillett
'

'
Rows("1:1").Select
Selection.Find(What:="c", After:=ActiveCell, LookIn:=xlFormulas, LookAt
_
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
End Sub

Sub findandselect()
Rows(1).Find("c", After:=Cells(1, 1), _
LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext).Activate
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"rockytopfan4ever" wrote in
message ...
I need a macro that will search for a cell with specific text within a row
and then select its appropriate column. Any ideas?


  #4   Report Post  
Posted to microsoft.public.excel.misc
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select specific text in cell John Gregory Excel Discussion (Misc queries) 30 February 17th 08 01:09 AM
Select specific column for auto filter [email protected] Excel Worksheet Functions 4 October 2nd 07 07:26 AM
How do I select cells within a column that contain a specific word Tobias Excel Worksheet Functions 1 September 28th 07 06:50 PM
Locate a specific row or column clara New Users to Excel 2 March 22nd 07 04:45 PM
Select cell containing specific text &return value from another ce plf100 Excel Worksheet Functions 4 November 16th 05 01:57 PM


All times are GMT +1. The time now is 10:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"