Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Do not delete row with cell in Column B = 0

The problem is not with the code but rather with line wrapping in your
browser. The code

RowNdx = Application.InputBox(Prompt:="Enter the number of the row you
want to delete")

should be on one line in VBA. You can split it into shorter lines with

RowNdx = Application.InputBox(Prompt:= _
"Enter the number of the" & _
"row you want to delete")

The <space<underscore line continuation character sequence indicates
that what appears in the editor as two lines is to be treated as one
line during complilation.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]





On Wed, 27 Jan 2010 19:39:00 GMT, "GBExcel via OfficeKB.com"
<u55438@uwe wrote:

Hi Ryan,

Appreciate the reply.

The line

RowNdx = Application.InputBox(Prompt:="Enter the number of the row you
want to delete")

produces an 'Expression expected.' error message?

I'm afraid I don't know enough about VBA to solve this.

GBExcel
=========

Ryan H wrote:
Try this. Hope this helps! If so, let me know, click "YES" below.

Dim RowNdx As Variant

RowNdx = Application.InputBox(Prompt:="Enter the number of the row you
want to delete")

If RowNdx = False Then
Exit Sub
ElseIf IsNumeric(RowNdx) And RowNdx 0 And _
RowNdx <= Rows.Count And Cells(RowNdx, "B") < "0" Then
Rows(RowNdx).Delete
Else
MsgBox "Stop! You may not delete the footer row.", vbCritical
End If

Hi,

[quoted text clipped - 34 lines]

GBExcel

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
delete numbers in each cell in same column Anna Huber Excel Worksheet Functions 7 June 11th 09 10:33 PM
Delete row with empty cell in column Gene Augustin Excel Discussion (Misc queries) 4 March 8th 09 08:03 AM
Delete Rows if any cell in Column H is blank but do not Delete Fir manfareed Excel Programming 4 September 28th 07 05:20 PM
delete a cell with a null value in column n Janis Excel Programming 3 July 18th 07 10:46 PM
How to delete the first word in every cell in a column Berit Excel Worksheet Functions 2 June 12th 07 12:38 PM


All times are GMT +1. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"