Thread: Delete Column
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Delete Column

Then you will need a loop. There is a good example in vba HELP index for
FIND that you could have found.
With Worksheets(1).Range("a1:a500")
Set c = .Find(2, lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
if ucase(c)="CLIENT" or ucase(c)="WHATEVER" then c.entirecolumn.delete'
c.Value = 5
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With

--
Don Guillett
SalesAid Software

"Phil" wrote in message
...
Hi,

Thanks for the help with this, if I have multiple finds in my row, to

explain,
if I have a row like A1, B1, C1, and I am looking for the words CLIENT or
CONTACT in either A1, B1, C1, do I seperate the find out something like
Find("client","contact")

Thanks again, Phil

"Don Guillett" wrote:

If you only have one you could use this. For multiples, post back

Sub findanddelete()
Columns(Rows(1).Find("client").Column).Delete
End Sub


--
Don Guillett
SalesAid Software

"Phil" wrote in message
...
Hi,

Can anyone tell me is it possible to delete a coulmn based upon what

is
shown in a specific cell, I have a worksheet that in perhaps either A1

or
B1
or C1 the word CLIENT might appear, in whichever column the word

appears I
want to delete that column, I can find lots on deleteing rows but

nothing
on
deleting columns (is it similar?).

Thanks for the help, Phil