Hi,
I have an excel sheet with hunderds of rows but I only need to keep tho rows in which the value in column A is smaller than 8000.
I have found a code ,which deletes entire rows if they are empty, I guess it can be altered somehow to delete entire rows if the value in column A in that row is smaller than 8000.
Here is the code:
'Step1 Declare your variables
Dim myRange As range
Dim icounter As Long
'Step2 Define the target range
Set myRange = ActiveSheet.usedrange
'Step3 Start reverse looping through the range
For icounter = myRange.Rows.count To 1 Step -1
'Step4 If entire column empty delete it.
If Application.count(Rows(icounter).entirerow) = 0 Then
Rows(icounter).Delete
End If
'step5 Increment the counter down
Next icounter
End Sub
Hope you can help with this,thanks!
I have an excel sheet with hunderds of rows but I only need to keep tho rows in which the value in column A is smaller than 8000.
I have found a code ,which deletes entire rows if they are empty, I guess it can be altered somehow to delete entire rows if the value in column A in that row is smaller than 8000.
Here is the code:
'Step1 Declare your variables
Dim myRange As range
Dim icounter As Long
'Step2 Define the target range
Set myRange = ActiveSheet.usedrange
'Step3 Start reverse looping through the range
For icounter = myRange.Rows.count To 1 Step -1
'Step4 If entire column empty delete it.
If Application.count(Rows(icounter).entirerow) = 0 Then
Rows(icounter).Delete
End If
'step5 Increment the counter down
Next icounter
End Sub
Hope you can help with this,thanks!