Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 128
Default Using New VBA code

I am trying to set up a macro to delete rows if some of the columns in the
row do not contain data.

here is the code that I am using:

Sub DeleteBlankRows2()
'Deletes the entire row within the selection if _
some of the cells WITHIN THE SELECTION contain no data.

On Error Resume Next

Selection.EntireRow.SpecialCells(xlBlanks) . EntireRow.Delete

On Error GoTo 0

End Sub

The columns have pick lists build in some, but if I leave the pick list
blank I want it to delete the entire row. When I run the macro I get a
Syntax Error that says something is not set up right.

Can anyone help me?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Using New VBA code

You have some extra spaces before the command 'entire row.delete'. Should be:

Selection.EntireRow.SpecialCells(xlBlanks).EntireR ow.Delete

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Kris" wrote:

I am trying to set up a macro to delete rows if some of the columns in the
row do not contain data.

here is the code that I am using:

Sub DeleteBlankRows2()
'Deletes the entire row within the selection if _
some of the cells WITHIN THE SELECTION contain no data.

On Error Resume Next

Selection.EntireRow.SpecialCells(xlBlanks) . EntireRow.Delete

On Error GoTo 0

End Sub

The columns have pick lists build in some, but if I leave the pick list
blank I want it to delete the entire row. When I run the macro I get a
Syntax Error that says something is not set up right.

Can anyone help me?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,123
Default Using New VBA code

Look out with this

See this page
http://www.rondebruin.nl/specialcells.htm

--

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


"Luke M" wrote in message ...
You have some extra spaces before the command 'entire row.delete'. Should be:

Selection.EntireRow.SpecialCells(xlBlanks).EntireR ow.Delete

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Kris" wrote:

I am trying to set up a macro to delete rows if some of the columns in the
row do not contain data.

here is the code that I am using:

Sub DeleteBlankRows2()
'Deletes the entire row within the selection if _
some of the cells WITHIN THE SELECTION contain no data.

On Error Resume Next

Selection.EntireRow.SpecialCells(xlBlanks) . EntireRow.Delete

On Error GoTo 0

End Sub

The columns have pick lists build in some, but if I leave the pick list
blank I want it to delete the entire row. When I run the macro I get a
Syntax Error that says something is not set up right.

Can anyone help me?

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
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Code to find code D. Excel Discussion (Misc queries) 2 August 12th 07 06:16 PM
Convert a Number Code to a Text Code Traye Excel Discussion (Misc queries) 3 April 6th 07 09:54 PM
Unprotect Code Module in Code Damien Excel Discussion (Misc queries) 2 April 18th 06 03:10 PM
copying vba code to a standard code module 1vagrowr Excel Discussion (Misc queries) 2 November 23rd 05 04:00 PM


All times are GMT +1. The time now is 11:18 PM.

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"