Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I want to delete data (entire row) within a certain range e.g. between 10% to 20%. My first cut at it is below but seems to delete everything! any help would be appreciated. Dim StRange As Integer Dim FinRange As Integer, LastRow&, i& Dim ColumnNum As Integer ColumnNum = InputBox("Column NUMBER with Dates of Interest (e.g. A=1)") StRange = InputBox("Values to be Deleted-ENTER Start Range % (0.00)") FinRange = InputBox("Values to be Deleted-ENTER End Range % (0.00)") LastRow = Cells(Rows.Count, ColumnNum).End(xlUp).Row For i = LastRow To 2 Step -1 If Cells(i, ColumnNum).Value = StRange And _ Cells(i, ColumnNum).Value <= FinRange Then Rows(i).Delete End If Next i End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to delete blank rows in a data range | Excel Discussion (Misc queries) | |||
delete rows in range - macro | Excel Worksheet Functions | |||
Macro to copy, paste in a range and then delete | Excel Discussion (Misc queries) | |||
trying to delete selected range with macro | Excel Programming | |||
What Excel 4.0 macro command do I need to use to delete a range na | Excel Programming |