LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Search for a cell.

Hi

This should do what you want

Sub findDelete()
Dim c As String
Dim Rng As Range
c = InputBox("Enter string to delete.")
Set Rng = Nothing
Set Rng = Range("C12:J12").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

"Tree*Rat" wrote in message
6.253...
I need to search for data in unknown cell ranging from
for example C12 to J12 (there may be more coulmns so i need to check the
cell is not empty, if empty then no need to check next column as it the
end of the list). Then I need to know which column the data is in
to delete the column.

Someone has already sujected recording a macro but i have had no luck in
this.

Bug thanks


 
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
Character Search a cell JPS Excel Worksheet Functions 8 March 17th 08 08:21 AM
highlighting a search cell Cowboy Excel Discussion (Misc queries) 3 November 7th 07 07:49 PM
FIND / SEARCH text compare cell to string in 3rd cell nastech Excel Discussion (Misc queries) 0 October 29th 07 02:51 AM
Search and go to cell furby Excel Worksheet Functions 2 October 8th 07 01:26 PM
format cell to search text in another cell Newbie Bob Excel Discussion (Misc queries) 2 October 25th 05 01:23 AM


All times are GMT +1. The time now is 02:29 AM.

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

About Us

"It's about Microsoft Excel"