![]() |
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 |
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 |
Delete Column
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 |
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 |
All times are GMT +1. The time now is 02:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com