doriannjeshi
Active Member
- Joined
- Apr 5, 2015
- Messages
- 337
- Office Version
- 365
- Platform
- Windows
Hi,
I have this macro that I need to make an adjustement to it
instead of having a fixed column Field:=16 , I need it to split the column based on the header name "example"
I have this macro that I need to make an adjustement to it
instead of having a fixed column Field:=16 , I need it to split the column based on the header name "example"
VBA Code:
Dim sht As Variant
Application.ScreenUpdating = False
With ActiveSheet '<- Change sheet name if required
For Each sht In Split("APL|FR|HRE", "|")
.Copy After:=Sheets(.Index)
With ActiveSheet
.Name = sht
With .UsedRange
.AutoFilter Field:=16, Criteria1:="<>" & sht
.Offset(1).EntireRow.Delete
.AutoFilter
End With
End With
Next sht
.Activate
End With
Application.ScreenUpdating = True
End Sub