Macro to move rows to a new location
Closed
Blind156
venkat1926
- Posts
- 4
- Registration date
- Friday June 6, 2014
- Status
- Member
- Last seen
- June 20, 2014
venkat1926
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
Related:
- Macro to move rows to a new location
- Macro to insert row in excel based on criteria ✓ - Forum - Excel
- Macro to insert row based on variable cell value (text) - Forum - Excel
- Excel macro to insert rows between data - Forum - Excel
- Insert Multi Rows Between Existing Data ✓ - Forum - Excel
- How to insert blank rows using macros in Excel - Guide
1 reply
venkat1926
Jun 7, 2014 at 07:19 AM
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
Jun 7, 2014 at 07:19 AM
suppose data is like this
HDNG1 HDNG2 HDNG3
11 76 1
59 3 2
24 30 8
62 25 6
62 34 9
try this macro
HDNG1 HDNG2 HDNG3
11 76 1
59 3 2
24 30 8
62 25 6
62 34 9
try this macro
Sub test()
Dim rdata As Range, dest As Range
Set rdata = Range("A1").CurrentRegion
Set dest = Range("A1").End(xlDown).Offset(4, 0)
rdata.AutoFilter field:=3, Criteria1:=8, Operator:=xlOr, Criteria2:=9
rdata.Offset(1, 0).Resize(rdata.Rows.Count - 1).SpecialCells(xlCellTypeVisible).Copy dest
ActiveSheet.AutoFilterMode = False
End Sub