Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Delete a row

I am checking if a particular cell is empty then I can
delete the entire
row..

This particular code is not working:
While Cells(i, 3) = ""
Rows("i:i").Select
Selection.Delete Shift:=xlUp
lastCellNum = lastCellNum - 1
i = i + 1
Wend

Thanks
monika

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Delete a row

Monik

1) has i been initialised to 1 somewhere
2) change the line
Rows("i:i").Selec
t
Rows(i & ":" & i).Selec

Ton

----- monika wrote: ----

I am checking if a particular cell is empty then I ca
delete the entir
row.
This particular code is not working

While Cells(i, 3) = "
Rows("i:i").Selec
Selection.Delete Shift:=xlU
lastCellNum = lastCellNum -
i = i +
Wen
Thank

monik


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Delete a row

Try this

Sub monika()
Dim i As Integer
Dim Lastcellnum
i = 1
Lastcellnum = 14
While i < Lastcellnum
If Cells(i, 1) = "" Then
Rows(i).Select
Selection.Delete Shift:=xlUp
Lastcellnum = Lastcellnum - 1
End If
i = i + 1
Wend
End Sub


-----Original Message-----
I am checking if a particular cell is empty then I can
delete the entire
row..

This particular code is not working:
While Cells(i, 3) = ""
Rows("i:i").Select
Selection.Delete Shift:=xlUp
lastCellNum = lastCellNum - 1
i = i + 1
Wend

Thanks
monika

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Delete a row

Rows(i) worked quite well....

thanks
"Damian Lee" wrote in message
...
Try this

Sub monika()
Dim i As Integer
Dim Lastcellnum
i = 1
Lastcellnum = 14
While i < Lastcellnum
If Cells(i, 1) = "" Then
Rows(i).Select
Selection.Delete Shift:=xlUp
Lastcellnum = Lastcellnum - 1
End If
i = i + 1
Wend
End Sub


-----Original Message-----
I am checking if a particular cell is empty then I can
delete the entire
row..

This particular code is not working:
While Cells(i, 3) = ""
Rows("i:i").Select
Selection.Delete Shift:=xlUp
lastCellNum = lastCellNum - 1
i = i + 1
Wend

Thanks
monika

.



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 the test values, but do not delete the formulas kathy Excel Discussion (Misc queries) 1 February 21st 07 07:03 PM
How can I delete a macro when the Delete button is not active? FCR Excel Worksheet Functions 0 March 9th 06 09:43 AM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
How do i delete a macro in Excel 2003 when delete isn't highlight Abel Excel Discussion (Misc queries) 2 September 13th 05 04:09 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM


All times are GMT +1. The time now is 07:12 AM.

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"