Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jessica, try this
Public Sub DeleteHighRows() Dim lngLastRow As Long Dim lngTemp As Long lngLastRow = ActiveSheet.Range("A65500").End(xlUp).Row Application.ScreenUpdating = False For lngTemp = lngLastRow To 1 Step -1 If ActiveSheet.Cells(lngTemp, 1).Value 1280 Then ActiveSheet.Rows(lngTemp).Delete Next lngTemp Application.ScreenUpdating = True End Sub Regards Rog -----Original Message----- Hello Guys! I have made a script for deleting rows where column A value is greater than 1280. It works fine but it will loop endlessly. What can I do about it? If I delete the "RowNumber = RowNumber - 1" then it does'nt work properly. TotalRows = Application.CountA(ActiveSheet.Range("A:A")) Cells(1, 1).Select For RowNumber = 1 To TotalRows If Cells(RowNumber, 1).Value 1280 Then Cells(RowNumber, 1).Select Selection.EntireRow.Delete RowNumber = RowNumber - 1 End If Next Please help me, Little Jessica ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
script for deleting images | Excel Discussion (Misc queries) | |||
OsCommerce - Easy Populate Script - CSV/TXT Conversion Problem. | Excel Discussion (Misc queries) | |||
deleting a macro resulted in a problem | Excel Discussion (Misc queries) | |||
networkdays() problem when deleting row or column | Excel Worksheet Functions | |||
Graph problem with VBA script | Excel Programming |