I have created a macro and inserted a macro button to process the macro.
The issue im having is that my macro button disappears as the cells i put it in get deleted as part of the macro.
is there any way of fixing a macro to a page so it does not get deleted but the columns its over does?
Below is my macro
The issue im having is that my macro button disappears as the cells i put it in get deleted as part of the macro.
is there any way of fixing a macro to a page so it does not get deleted but the columns its over does?
Below is my macro
VBA Code:
Sub Step1datasort()
'
' Step1datasort Macro
'
'
Columns("B:L").Select
Selection.Delete Shift:=xlToLeft
Columns("C:C").Select
Selection.Delete Shift:=xlToLeft
Columns("D:G").Select
Selection.Delete Shift:=xlToLeft
Columns("D:G").EntireColumn.AutoFit
Columns("E:J").Select
Selection.Delete Shift:=xlToLeft
Columns("F:N").Select
Selection.Delete Shift:=xlToLeft
Columns("G:BS").Select
Selection.Delete Shift:=xlToLeft
Rows("1:1").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A1").Select
ActiveCell.FormulaR1C1 = "Order"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Units"
Range("C1").Select
ActiveCell.FormulaR1C1 = "Time"
Range("D1").Select
ActiveCell.FormulaR1C1 = "Date"
Range("E1").Select
ActiveCell.FormulaR1C1 = "Category"
Range("F1").Select
ActiveCell.FormulaR1C1 = "User"
Columns("A:F").Select
ActiveWorkbook.Names.Add Name:="Info", RefersToR1C1:="='Data '!C1:C6"
End Sub
Last edited by a moderator: