Macro to delete rows between named ranges in excel
Closed
prafulk
Posts
1
Registration date
Monday July 15, 2013
Status
Member
Last seen
July 15, 2013
-
Jul 15, 2013 at 05:46 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Jul 16, 2013 at 12:02 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Jul 16, 2013 at 12:02 PM
Related:
- Macro to delete rows between named ranges in excel
- Spell number in excel without macro - Guide
- Excel date format dd.mm.yyyy - Guide
- How to enable vba in excel - Guide
- Transfer data from one excel worksheet to another automatically - Guide
- Macros in excel download - Download - Spreadsheets
1 reply
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 16, 2023
547
Jul 16, 2013 at 12:02 PM
Jul 16, 2013 at 12:02 PM
Hi Prafulk,
This code will delete rows between your named ranges SUBHEADER_001 and SUBFOOTER_001:
Best regards,
Trowa
This code will delete rows between your named ranges SUBHEADER_001 and SUBFOOTER_001:
Sub Test() Dim fRow, lRow As Integer fRow = Range("SUBHEADER_001").Row + 1 lRow = Range("SUBFOOTER_001").Row - 1 If lRow < 2 Then Exit Sub Range(Rows(fRow), Rows(lRow)).Delete End Sub
Best regards,
Trowa