gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,341
- Office Version
- 365
- Platform
- Windows
I am trying to use VBA to delete specified row. I want to delete from row 16 down to a dynamic number.
I am using =COUNTA(PartTask_Table[ItemId]) in cell D14. This tells me how many rows I have in the table.
I am trying this code but the "Rows(“fromrow:torow”).EntireRow.Delete" is colored red in my code.
Also how could I use this to enter/insert X number of rows?
Thanks for the help
I am using =COUNTA(PartTask_Table[ItemId]) in cell D14. This tells me how many rows I have in the table.
I am trying this code but the "Rows(“fromrow:torow”).EntireRow.Delete" is colored red in my code.
Code:
Sub TestThis()
Dim fromrow As String
Dim torow As String
'On Error Resume Next ‘Blanket error handling
fromrow = Sheet9.Range("16")
torow = Sheet9.Range("D14").Value
Rows(“fromrow:torow”).EntireRow.Delete
End Sub
Also how could I use this to enter/insert X number of rows?
Thanks for the help