PC Review


Reply
Thread Tools Rate Thread

Delete Column

 
 
Bernie
Guest
Posts: n/a
 
      28th Feb 2007
In Excel, I need a macro that will delete a column based on a cell
that will contain a name based on an input box.

Thanks,
Bernie

 
Reply With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      28th Feb 2007
Bernie

Will the name be found only in one column or many columns?

If many, which one or more of the many would you like deleted?


Gord Dibben MS Excel MVP

On 28 Feb 2007 12:40:39 -0800, "Bernie" <(E-Mail Removed)> wrote:

>In Excel, I need a macro that will delete a column based on a cell
>that will contain a name based on an input box.
>
>Thanks,
>Bernie


 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      28th Feb 2007
Have a look in the vba HELP index for FIND or FINDNEXT.
--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Bernie" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In Excel, I need a macro that will delete a column based on a cell
> that will contain a name based on an input box.
>
> Thanks,
> Bernie
>



 
Reply With Quote
 
Bernie
Guest
Posts: n/a
 
      28th Feb 2007
On Feb 28, 3:55 pm, Gord Dibben <gorddibbATshawDOTca> wrote:
> Bernie
>
> Will the name be found only in one column or many columns?
>
> If many, which one or more of the many would you like deleted?
>
> Gord Dibben MS Excel MVP
>
> On 28 Feb 2007 12:40:39 -0800, "Bernie" <b...@aol.com> wrote:
>
>
>
> >In Excel, I need a macro that will delete a column based on a cell
> >that will contain a name based on an input box.

>
> >Thanks,
> >Bernie- Hide quoted text -

>
> - Show quoted text -




The name will be found only in one column. Thanks!


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      28th Feb 2007
Try this with a fixed column.

Note the lines to make it a selectable column if you wanted.

Public Sub DeleteColOnWord()
Dim coltocheck As Range
Dim thename As String
On Error GoTo endit

Set coltocheck = Range("D")
' Set coltocheck = Application.InputBox(Prompt:= _
' "Select A Column", Type:=8)
thename = InputBox("enter a name")
For Each i In coltocheck
If i.Value = thename Then _
i.EntireColumn.Delete
Next i

endit:
End Sub


Gord

On 28 Feb 2007 13:34:53 -0800, "Bernie" <(E-Mail Removed)> wrote:

>On Feb 28, 3:55 pm, Gord Dibben <gorddibbATshawDOTca> wrote:
>> Bernie
>>
>> Will the name be found only in one column or many columns?
>>
>> If many, which one or more of the many would you like deleted?
>>
>> Gord Dibben MS Excel MVP
>>
>> On 28 Feb 2007 12:40:39 -0800, "Bernie" <b...@aol.com> wrote:
>>
>>
>>
>> >In Excel, I need a macro that will delete a column based on a cell
>> >that will contain a name based on an input box.

>>
>> >Thanks,
>> >Bernie- Hide quoted text -

>>
>> - Show quoted text -

>
>
>
>The name will be found only in one column. Thanks!
>


 
Reply With Quote
 
Bernie
Guest
Posts: n/a
 
      1st Mar 2007
On Feb 28, 6:43 pm, Gord Dibben <gorddibbATshawDOTca> wrote:
> Try this with a fixed column.
>
> Note the lines to make it a selectable column if you wanted.
>
> Public Sub DeleteColOnWord()
> Dim coltocheck As Range
> Dim thename As String
> On Error GoTo endit
>
> Set coltocheck = Range("D")
> ' Set coltocheck = Application.InputBox(Prompt:= _
> ' "Select A Column", Type:=8)
> thename = InputBox("enter a name")
> For Each i In coltocheck
> If i.Value = thename Then _
> i.EntireColumn.Delete
> Next i
>
> endit:
> End Sub
>
> Gord
>
> On 28 Feb 2007 13:34:53 -0800, "Bernie" <b...@aol.com> wrote:
>
>
>
> >On Feb 28, 3:55 pm, Gord Dibben <gorddibbATshawDOTca> wrote:
> >> Bernie

>
> >> Will the name be found only in one column or many columns?

>
> >> If many, which one or more of the many would you like deleted?

>
> >> Gord Dibben MS Excel MVP

>
> >> On 28 Feb 2007 12:40:39 -0800, "Bernie" <b...@aol.com> wrote:

>
> >> >In Excel, I need a macro that will delete a column based on a cell
> >> >that will contain a name based on an input box.

>
> >> >Thanks,
> >> >Bernie- Hide quoted text -

>
> >> - Show quoted text -

>
> >The name will be found only in one column. Thanks!- Hide quoted text -

>
> - Show quoted text -


Thank you so much, I modified it to fit my current workbook and it
worked perfectly.

Bernie


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      1st Mar 2007
Thanks for the feedback.

Gord

On 1 Mar 2007 06:00:04 -0800, "Bernie" <(E-Mail Removed)> wrote:

>On Feb 28, 6:43 pm, Gord Dibben <gorddibbATshawDOTca> wrote:
>> Try this with a fixed column.
>>
>> Note the lines to make it a selectable column if you wanted.
>>
>> Public Sub DeleteColOnWord()
>> Dim coltocheck As Range
>> Dim thename As String
>> On Error GoTo endit
>>
>> Set coltocheck = Range("D")
>> ' Set coltocheck = Application.InputBox(Prompt:= _
>> ' "Select A Column", Type:=8)
>> thename = InputBox("enter a name")
>> For Each i In coltocheck
>> If i.Value = thename Then _
>> i.EntireColumn.Delete
>> Next i
>>
>> endit:
>> End Sub
>>
>> Gord
>>
>> On 28 Feb 2007 13:34:53 -0800, "Bernie" <b...@aol.com> wrote:
>>
>>
>>
>> >On Feb 28, 3:55 pm, Gord Dibben <gorddibbATshawDOTca> wrote:
>> >> Bernie

>>
>> >> Will the name be found only in one column or many columns?

>>
>> >> If many, which one or more of the many would you like deleted?

>>
>> >> Gord Dibben MS Excel MVP

>>
>> >> On 28 Feb 2007 12:40:39 -0800, "Bernie" <b...@aol.com> wrote:

>>
>> >> >In Excel, I need a macro that will delete a column based on a cell
>> >> >that will contain a name based on an input box.

>>
>> >> >Thanks,
>> >> >Bernie- Hide quoted text -

>>
>> >> - Show quoted text -

>>
>> >The name will be found only in one column. Thanks!- Hide quoted text -

>>
>> - Show quoted text -

>
>Thank you so much, I modified it to fit my current workbook and it
>worked perfectly.
>
>Bernie
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy column header to next column, delete & delete every nth colum genehunter Microsoft Excel New Users 1 2nd Jun 2009 03:57 PM
Search from bottom of column up column and delete to top Jools Microsoft Excel Programming 1 23rd Jan 2008 02:05 AM
Delete Rows if any cell in Column H is blank but do not Delete Fir =?Utf-8?B?bWFuZmFyZWVk?= Microsoft Excel Programming 4 28th Sep 2007 05:20 PM
Find Column heading and then Delete entire column Kobayashi Microsoft Excel Programming 4 17th Oct 2005 09:09 PM
Delete All Rows That Column A value is not in Column A of Sheet2 paxdak@yahoo.com Microsoft Excel Programming 2 3rd Sep 2004 09:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:02 PM.