PC Review


Reply
Thread Tools Rate Thread

Delete Blank Rows - specify column via dialog

 
 
porter444
Guest
Posts: n/a
 
      30th Nov 2007
From time to time I have worksheets of data that have rows I want to
eliminate. The rows I want to delete usually have something in common like,
all have a blank value in a specific column.

In the past I have just modified a macro to specify which column I want to
deal with. Like this for column B:
Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete

Wondering if there is a way to write a macro that when run would give me a
dialog box and ask which column to look in so I don't have to change the
macro for the different situations.

Logically, something like this:

Columns(DIALOG BOX ENTRY).SpecialCells(xlCellTypeBlanks).EntireRow.Delete

Can you help?

Thanks in advance,

Scott
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      30th Nov 2007
Why not use the column of the active cell ?
Columns(ActiveCell.Column)

See also this page for a possible problem
http://www.rondebruin.nl/specialcells.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"porter444" <(E-Mail Removed)> wrote in message newsF43CEB9-453C-4355-B5BD-(E-Mail Removed)...
> From time to time I have worksheets of data that have rows I want to
> eliminate. The rows I want to delete usually have something in common like,
> all have a blank value in a specific column.
>
> In the past I have just modified a macro to specify which column I want to
> deal with. Like this for column B:
> Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
>
> Wondering if there is a way to write a macro that when run would give me a
> dialog box and ask which column to look in so I don't have to change the
> macro for the different situations.
>
> Logically, something like this:
>
> Columns(DIALOG BOX ENTRY).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
>
> Can you help?
>
> Thanks in advance,
>
> Scott

 
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
Delete all rows where column A is blank Jodie Microsoft Excel Programming 6 14th Dec 2009 07:30 PM
Delete rows if column looks blank robyn_willson@hotmail.com Microsoft Excel Programming 4 18th Feb 2009 07:21 PM
delete the non blank rows depending on Column Harn88 Microsoft Excel Programming 1 18th Nov 2008 08:37 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
Delete entire rows where there is a blank in column A Chris Hankin Microsoft Excel Programming 7 11th Jun 2006 09:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:59 PM.