Afternoon,
I have recorded the following Macro on Excel, All i am trying to do is delete all the unwanted info from the reports i download from the system at work and have it set up to how i want it at the hit of the button.
I keep getting a debug message with the activesheet.Paste being highlighted
I have not touched anything with in the macro. Also every time i redo the Macro to try to fix it, it keeps coming up with a different error.
Help!!! im pulling my hair out
I require, in the same order, Columns F,G,A,B,C,E,J,M and N
Then have it Format it as a Table Blue, Table Style Medium 9
Unfortunately i cannot post attachments
Your Help in this is much appreciated.
Thanks
I have recorded the following Macro on Excel, All i am trying to do is delete all the unwanted info from the reports i download from the system at work and have it set up to how i want it at the hit of the button.
I keep getting a debug message with the activesheet.Paste being highlighted
I have not touched anything with in the macro. Also every time i redo the Macro to try to fix it, it keeps coming up with a different error.
Help!!! im pulling my hair out
I require, in the same order, Columns F,G,A,B,C,E,J,M and N
Then have it Format it as a Table Blue, Table Style Medium 9
Code:
Sub BinLocationReport()
'
' BinLocationReport Macro
'
'
Sheets("Parts Bin Location Report201904").Select
Sheets("Parts Bin Location Report201904").Name = "Parts Bin Location Report"
Sheets.Add After:=ActiveSheet
Sheets("Parts Bin Location Report").Select
Columns("F:F").Select
Selection.Cut
Columns("F:G").Select
Application.CutCopyMode = False
Selection.Cut
Sheets("Sheet1").Select
Range("A1").Select
ActiveSheet.Paste
Sheets("Parts Bin Location Report").Select
Columns("A:C").Select
Selection.Cut
Sheets("Sheet1").Select
Range("C1").Select
ActiveSheet.Paste
Sheets("Parts Bin Location Report").Select
Columns("E:E").Select
Selection.Cut
Sheets("Sheet1").Select
Range("F1").Select
ActiveSheet.Paste
Sheets("Parts Bin Location Report").Select
Columns("J:J").Select
Selection.Cut
Sheets("Sheet1").Select
Range("G1").Select
ActiveSheet.Paste
Sheets("Parts Bin Location Report").Select
Columns("M:N").Select
Selection.Cut
Sheets("Sheet1").Select
Range("H1").Select
ActiveSheet.Paste
Range("A1:I4328").Select
Range("C4").Activate
Application.CutCopyMode = False
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$I$4328"), , xlYes).Name = _
"Table1"
Range("Table1[#All]").Select
ActiveSheet.ListObjects("Table1").TableStyle = "TableStyleMedium9"
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
Columns("C:E").Select
Selection.NumberFormat = "@"
Range("J2").Select
ActiveSheet.Paste
Range("J2").Select
ActiveCell.FormulaR1C1 = _
"=IF([@[Qty_In_Pick]]+[@[Qty_On_Hand]]+[@[Qty_On_Order_Supplier]]<=0,""Y"",""N"")"
Range("J3").Select
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=10, Criteria1:= _
"Y"
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=10, Criteria1:= _
"N"
Rows("2:2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=10
Columns("J:J").Select
Selection.Delete Shift:=xlToLeft
Range("D2").Select
End Sub
Unfortunately i cannot post attachments
Your Help in this is much appreciated.
Thanks
Last edited by a moderator: