Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default finding column

Gooday all,

I currently have some names in various columns but on the same same row. I
have at the moment been able to search for a name in the column. But as I
dont know the actual cell how can I find the cell name?

example names are in D12, E12 .... P12 they are all on row 12 but I dont
know the column. the search looks at each column untill it finds a match,
if it gets to an empty cell on row 12 the search ends, if it find the cell
I need to delete the column. Taking into acount that P12 may go as far as
FF12!! I dont actualy know.

Does this make sense?
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default finding column

Use the MATCH() function:

If cell F1 contains:
James
then the formula:
=MATCH("James",1:1) will return 6 (which is column F)
--
Gary''s Student - gsnu2007k


"Squirrel-Salad" wrote:

Gooday all,

I currently have some names in various columns but on the same same row. I
have at the moment been able to search for a name in the column. But as I
dont know the actual cell how can I find the cell name?

example names are in D12, E12 .... P12 they are all on row 12 but I dont
know the column. the search looks at each column untill it finds a match,
if it gets to an empty cell on row 12 the search ends, if it find the cell
I need to delete the column. Taking into acount that P12 may go as far as
FF12!! I dont actualy know.

Does this make sense?

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,480
Default finding column

Hi

Try the following

Sub findDelete()
Dim c As String
Dim Rng As Range
c = InputBox("Enter string to delete.")
Set Rng = Nothing
Set Rng = Range("12:12").Find(what:=c, _
After:=Range("C12"), _
LookIn:=xlFormulas, _
lookat:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False)
Rng.EntireColumn.Delete shift:=xlLeft
End Sub

--
Regards
Roger Govier

"Squirrel-Salad" wrote in message
6.253...
Gooday all,

I currently have some names in various columns but on the same same row. I
have at the moment been able to search for a name in the column. But as I
dont know the actual cell how can I find the cell name?

example names are in D12, E12 .... P12 they are all on row 12 but I dont
know the column. the search looks at each column untill it finds a match,
if it gets to an empty cell on row 12 the search ends, if it find the cell
I need to delete the column. Taking into acount that P12 may go as far as
FF12!! I dont actualy know.

Does this make sense?


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
finding the largest value for a name in a column and then returningthe result from a different column [email protected] Excel Worksheet Functions 1 April 14th 08 10:08 AM
Finding the same value in another column Richard Excel Worksheet Functions 0 April 24th 07 09:26 PM
Finding a number in a column out of an array in another column cirena Excel Discussion (Misc queries) 3 April 4th 07 06:30 PM
Finding Info from Column A and Removing it from Column B Johnny B[_2_] Excel Discussion (Misc queries) 2 March 28th 07 12:06 PM
Finding the closest number in column A and take the value in column B reefguy Excel Worksheet Functions 3 May 5th 06 07:25 PM


All times are GMT +1. The time now is 07:11 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"