mathsbeauty
Board Regular
- Joined
- Apr 23, 2011
- Messages
- 89
Hello! The following command works:
Sheets(1).rows("10:20").delete
It deletes the rows from 10 to 20.
I have general problem. Given two numbers say Num1 and Num2. I want to delete the rows from Num1 to Num2. I have tried something like:
I get application defined or object defined error. Can you suggest correction required?
Sheets(1).rows("10:20").delete
It deletes the rows from 10 to 20.
I have general problem. Given two numbers say Num1 and Num2. I want to delete the rows from Num1 to Num2. I have tried something like:
Code:
Sub DeleteRows()
Dim Num1 As Long, Num2 As Long
Num1 = 10
Num2 = 20
Activeworkbook.Sheets(1).Rows("Num1:Num2").Delete
End Sub
Last edited: