Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
delete numbers in each cell in same column | Excel Worksheet Functions | |||
Delete row with empty cell in column | Excel Discussion (Misc queries) | |||
Delete Rows if any cell in Column H is blank but do not Delete Fir | Excel Programming | |||
delete a cell with a null value in column n | Excel Programming | |||
How to delete the first word in every cell in a column | Excel Worksheet Functions |