Hello,
I'd like to place a macro button on sheet1 but the macro should run/perform on sheet2. What do I need to do in VBA to make this happen? I'm relatively new to VBA so not sure where I would put my sheet reference. Here is my current VBA code.
If you need any other details, please let me know.
Sub Avid_GL()
'
' Avid_GL Macro
'
'
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
End With
Selection.UnMerge
Selection.ColumnWidth = 15.14
Rows("1:8").Select
Selection.Delete Shift:=xlUp
Columns("B:D").Select
Selection.Delete Shift:=xlToLeft
Range("C:C,E:E,F:F,H:H,I:I,K:K").Select
Range("K1").Activate
Selection.Delete Shift:=xlToLeft
Columns("G:H").Select
Selection.Delete Shift:=xlToLeft
Range("H2").Select
Selection.End(xlToRight).Select
Selection.End(xlToLeft).Select
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
End Sub
I'd like to place a macro button on sheet1 but the macro should run/perform on sheet2. What do I need to do in VBA to make this happen? I'm relatively new to VBA so not sure where I would put my sheet reference. Here is my current VBA code.
If you need any other details, please let me know.
Sub Avid_GL()
'
' Avid_GL Macro
'
'
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
End With
Selection.UnMerge
Selection.ColumnWidth = 15.14
Rows("1:8").Select
Selection.Delete Shift:=xlUp
Columns("B:D").Select
Selection.Delete Shift:=xlToLeft
Range("C:C,E:E,F:F,H:H,I:I,K:K").Select
Range("K1").Activate
Selection.Delete Shift:=xlToLeft
Columns("G:H").Select
Selection.Delete Shift:=xlToLeft
Range("H2").Select
Selection.End(xlToRight).Select
Selection.End(xlToLeft).Select
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
End Sub