I have recorded a macro, and edited it to as it is below:
Sheets.Add.Name = "Minor" 'Add Worksheets - with titles'
Sheets.Add.Name = "Fire Chargeable"
Sheets.Add.Name = "Fire Non Chargeable"
Sheets.Add.Name = "Chargeable"
Sheets.Add.Name = "Non Chargeable"
Sheets("Sheet 1").Select
Rows("1:1").Select
Selection.AutoFilter 'add filter'
Range("G2").Select
ActiveWindow.FreezePanes = True 'Freeze Pane'
Range("G5").Select
Selection.AutoFilter Field:=3, Criteria1:="MWK"
Rows("24:32").Select
Selection.Cut
Sheets("Minor").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("Sheet 1").Select
Selection.AutoFilter Field:=3 'Close Filter'
Selection.AutoFilter Field:=27, Criteria1:="=CCTV*", Operator:=xlOr, _
Criteria2:="=ACC*" 'Filter for ACC and CCTV'
Rows("02:50").Select
Selection.Cut 'ONLY CUT ROWS THAT ARE VISIBLE'
Sheets("Chargeable").Select
Range("A2").Select
ActiveSheet.Paste
Range("B11").Select
Sheets("sheet 1").Select
Rows("1:1").Select
Selection.Copy
Sheets("Chargeable").Select
Rows("1:1").Select
ActiveSheet.Paste
Sheets("Fire Non Chargeable").Select
Rows("1:1").Select
ActiveSheet.Paste
Sheets("Fire Chargeable").Select
Rows("1:1").Select
ActiveSheet.Paste
Sheets("Minor").Select
Rows("1:1").Select
ActiveSheet.Paste
Sheets("Non Chargeable").Select
Rows("1:1").Select
ActiveSheet.Paste
where i have added a notation 'ONLY CUT ROWS THAT ARE VISIBLE'... How do i do this??? what code should i add.
Also can any one help me tidy this code up a little?
Sheets.Add.Name = "Minor" 'Add Worksheets - with titles'
Sheets.Add.Name = "Fire Chargeable"
Sheets.Add.Name = "Fire Non Chargeable"
Sheets.Add.Name = "Chargeable"
Sheets.Add.Name = "Non Chargeable"
Sheets("Sheet 1").Select
Rows("1:1").Select
Selection.AutoFilter 'add filter'
Range("G2").Select
ActiveWindow.FreezePanes = True 'Freeze Pane'
Range("G5").Select
Selection.AutoFilter Field:=3, Criteria1:="MWK"
Rows("24:32").Select
Selection.Cut
Sheets("Minor").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("Sheet 1").Select
Selection.AutoFilter Field:=3 'Close Filter'
Selection.AutoFilter Field:=27, Criteria1:="=CCTV*", Operator:=xlOr, _
Criteria2:="=ACC*" 'Filter for ACC and CCTV'
Rows("02:50").Select
Selection.Cut 'ONLY CUT ROWS THAT ARE VISIBLE'
Sheets("Chargeable").Select
Range("A2").Select
ActiveSheet.Paste
Range("B11").Select
Sheets("sheet 1").Select
Rows("1:1").Select
Selection.Copy
Sheets("Chargeable").Select
Rows("1:1").Select
ActiveSheet.Paste
Sheets("Fire Non Chargeable").Select
Rows("1:1").Select
ActiveSheet.Paste
Sheets("Fire Chargeable").Select
Rows("1:1").Select
ActiveSheet.Paste
Sheets("Minor").Select
Rows("1:1").Select
ActiveSheet.Paste
Sheets("Non Chargeable").Select
Rows("1:1").Select
ActiveSheet.Paste
where i have added a notation 'ONLY CUT ROWS THAT ARE VISIBLE'... How do i do this??? what code should i add.
Also can any one help me tidy this code up a little?