Sub macro1_all()
Application.Run "macro2"
Application.Run "macro3"
Application.Run "macro4"
Application.Run "macro5"
Application.Run "macro6"
Application.Run "macro7"
End Sub
Sub Macro2()
''''assumes column A is always populated.
'''find last row in the sheet, to be used as reference for copy and paste later
'''cut and paste the value to cell Z1, so it is a static reference of cell Z1
'''in Z2 Z3, use a minus one and minus two because the number of rows you use later will be minus 2 of the total rows
Sheets("Live").Select
Application.Goto Reference:="R999999C1"
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.Copy
Selection.Clear
Selection.FormulaR1C1 = "=ROW()"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.Cut
Application.Goto Reference:="R1C26"
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=R[-1]C-1"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=R[-1]C-1"
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Silent").Select
Application.Goto Reference:="R999999C1"
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.Copy
Selection.Clear
Selection.FormulaR1C1 = "=ROW()"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.Cut
Application.Goto Reference:="R1C26"
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=R[-1]C-1"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=R[-1]C-1"
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub
Sub Macro3()
'bring in headers from your Bidder Sheet in H1
Sheets("Live").Select
Application.Goto Reference:="R1C8"
Selection.FormulaR1C1 = "=Bidders!RC[-7]"
''' bring in A to O, as you probably have a lot more information than your sample
Selection.Copy
Range("H1:V1").Select
ActiveSheet.Paste
'bring in headers from your Bidder Sheet in H1
Sheets("Silent").Select
Application.Goto Reference:="R1C8"
Selection.FormulaR1C1 = "=Bidders!RC[-7]"
''' bring in A to O, as you probably have a lot more information than your sample
Selection.Copy
Range("H1:V1").Select
ActiveSheet.Paste
End Sub
Sub Macro4()
'''set up Lookup formulas to bring in data from Bidder sheet
Sheets("Live").Select
Application.Goto Reference:="R2C8"
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-7]:C[18],MATCH(RC[-5],Bidders!C[-7],0),1)"
Range("I2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-8]:C[17],MATCH(RC[-6],Bidders!C[-8],0),2)"
Range("J2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-9]:C[16],MATCH(RC[-7],Bidders!C[-9],0),3)"
Range("K2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-10]:C[15],MATCH(RC[-8],Bidders!C[-10],0),4)"
Range("L2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-11]:C[14],MATCH(RC[-9],Bidders!C[-11],0),5)"
Range("M2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-12]:C[13],MATCH(RC[-10],Bidders!C[-12],0),6)"
Range("N2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-13]:C[12],MATCH(RC[-11],Bidders!C[-13],0),7)"
Range("O2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-14]:C[11],MATCH(RC[-12],Bidders!C[-14],0),8)"
Range("P2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-15]:C[10],MATCH(RC[-13],Bidders!C[-15],0),9)"
Range("Q2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-16]:C[9],MATCH(RC[-14],Bidders!C[-16],0),10)"
Range("R2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-17]:C[8],MATCH(RC[-15],Bidders!C[-17],0),11)"
Range("S2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-18]:C[7],MATCH(RC[-16],Bidders!C[-18],0),12)"
Range("T2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-19]:C[6],MATCH(RC[-17],Bidders!C[-19],0),13)"
Range("U2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-20]:C[5],MATCH(RC[-18],Bidders!C[-20],0),14)"
Range("V2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-21]:C[4],MATCH(RC[-19],Bidders!C[-21],0),15)"
'copy paste formulas for all the Bidders in your sheet
Application.Goto Reference:="R2C8"
Selection.Copy
ActiveCell.Range("A1:O1").Select
Selection.Copy
''' ActiveCell.Range("A1:O11").Select. notice this line of code is changed to use cell Z3, so it is not always static
ActiveCell.Range("A1:O" & Range("z3")).Select
ActiveSheet.Paste
'''set up Lookup formulas to bring in data from Bidder sheet
Sheets("Silent").Select
Application.Goto Reference:="R2C8"
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-7]:C[18],MATCH(RC[-5],Bidders!C[-7],0),1)"
Range("I2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-8]:C[17],MATCH(RC[-6],Bidders!C[-8],0),2)"
Range("J2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-9]:C[16],MATCH(RC[-7],Bidders!C[-9],0),3)"
Range("K2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-10]:C[15],MATCH(RC[-8],Bidders!C[-10],0),4)"
Range("L2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-11]:C[14],MATCH(RC[-9],Bidders!C[-11],0),5)"
Range("M2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-12]:C[13],MATCH(RC[-10],Bidders!C[-12],0),6)"
Range("N2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-13]:C[12],MATCH(RC[-11],Bidders!C[-13],0),7)"
Range("O2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-14]:C[11],MATCH(RC[-12],Bidders!C[-14],0),8)"
Range("P2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-15]:C[10],MATCH(RC[-13],Bidders!C[-15],0),9)"
Range("Q2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-16]:C[9],MATCH(RC[-14],Bidders!C[-16],0),10)"
Range("R2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-17]:C[8],MATCH(RC[-15],Bidders!C[-17],0),11)"
Range("S2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-18]:C[7],MATCH(RC[-16],Bidders!C[-18],0),12)"
Range("T2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-19]:C[6],MATCH(RC[-17],Bidders!C[-19],0),13)"
Range("U2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-20]:C[5],MATCH(RC[-18],Bidders!C[-20],0),14)"
Range("V2").Select
Selection.FormulaR1C1 = "=INDEX(Bidders!C[-21]:C[4],MATCH(RC[-19],Bidders!C[-21],0),15)"
'copy paste formulas for all the Bidders in your sheet
Application.Goto Reference:="R2C8"
Selection.Copy
ActiveCell.Range("A1:O1").Select
Selection.Copy
''' ActiveCell.Range("A1:O11").Select. notice this line of code is changed to use cell Z3, so it is not always static
ActiveCell.Range("A1:O" & Range("z3")).Select
ActiveSheet.Paste
End Sub
Sub Macro5()
'copy to Check out, from A2 to V
Sheets("Live").Select
Application.Goto Reference:="R2C1"
''' ActiveCell.Range("A1:V12").Select
ActiveCell.Range("A1:V" & Range("z3")).Select
Selection.Copy
Calculate
Selection.Copy
Sheets("Check out").Select
Application.Goto Reference:="R999999C1"
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
'copy to Check out, from A2 to V
Sheets("Silent").Select
Application.Goto Reference:="R2C1"
''' ActiveCell.Range("A1:V12").Select
ActiveCell.Range("A1:V" & Range("z3")).Select
Selection.Copy
Calculate
Selection.Copy
Sheets("Check out").Select
Application.Goto Reference:="R999999C1"
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub
Sub Macro6()
'''for sorting
''''assumes column A is always populated.
'''find last row in the sheet, to be used as reference for copy and paste later
'''cut and paste the value to cell Z1, so it is a static reference of cell Z1
'''in Z2 Z3, use a minus one and minus two because the number of rows you use later will be minus 2 of the total rows
Sheets("Check out").Select
Application.Goto Reference:="R999999C1"
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.Copy
Selection.Clear
Selection.FormulaR1C1 = "=ROW()"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.Cut
Application.Goto Reference:="R1C26"
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=R[-1]C-1"
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.FormulaR1C1 = "=R[-1]C-1"
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub
Sub Macro7()
'sort by column C Bidder #
Sheets("Check out").Select
Application.Goto Reference:="R1C1"
Application.Goto Reference:="R2C1"
ActiveCell.Range("A1:Y" & Range("z2")).Select
ActiveSheet.Sort.SortFields.Clear
ActiveSheet.Sort.SortFields.Add2 Key:=ActiveCell.Offset(0, 2).Range("A1:A" & Range("z2")), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveSheet.Sort
.SetRange ActiveCell.Range("A1:Y" & Range("z2"))
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub