Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Delete Column

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Delete Column

Simple way

If Range("A1").Value = "CLIENT" Then
Columns(1).Delete
ElseIf Range("B1").Value = "CLIENT" Then
Columns(2).Delete
ElseIf Range("C1").Value = "CLIENT" Then
Columns(3).Delete
End If



--
HTH

Bob Phillips

"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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Delete Column

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




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
Copy column header to next column, delete & delete every nth colum genehunter New Users to Excel 1 June 2nd 09 03:57 PM
delete cells column. Delete empty cells myshak Excel Worksheet Functions 0 March 9th 09 10:59 PM
How do I delete everything after a / in a column? henderson Excel Worksheet Functions 17 July 19th 07 06:55 PM
Delete All Rows That Column A value is not in Column A of Sheet2 [email protected] Excel Programming 2 September 3rd 04 09:13 PM
Delete a Row if a Certain Value is in Column C John Excel Programming 10 June 13th 04 01:03 PM


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