hi
i have created 3 macros so far in my workbook each of them doing a dif. thing ie:
1- print_and_sort ( filters the list then prints a copy with the items list with a value bigger than 0)
2- Stock_IN_update ( since i could not figure a function to do exactly what i wanted i recorded a macro to fetch 2 columns ( "Stock IN"and "Actual Stock" ) do a sum then copy total column cells and paste it back in "Actual Stock" as an update, then delete created sum columns and clear column "Stock IN"and input 0 value for next time.
here is macro code just in case i missed out something
Sub Stock_IN_update()
'
' Stock_IN_update Macro
'
'
Range("Table3[Stock IN]").Select
Selection.Copy
Sheets("ACTUAL STOCK").Select
Range("M2:M71").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("Table2[Actual Stock]").Select
Range("D71").Activate
Application.CutCopyMode = False
Selection.Copy
Range("L2:L71").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("K71").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=RC[1]+RC[2]"
Range("K71").Select
Selection.AutoFill Destination:=Range("K2:K71"), Type:=xlFillDefault
Range("K2:K71").Select
Range("K2").Select
ActiveWindow.SmallScroll Down:=-6
Range("K2:K71").Select
Selection.Copy
Range("Table2[Actual Stock]").Select
Range("D71").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("J2:N72").Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("stock updates").Select
Range("D2").Select
ActiveCell.FormulaR1C1 = "0"
Selection.AutoFill Destination:=Range("Table3[Stock IN]"), Type:= _
xlFillDefault
Range("Table3[Stock IN]").Select
Range("G73").Select
End Sub
3- Stock_OUT_update exaclty the same as "Stock_IN_update" macro but instead it subtracts
all macros run as a button
im prety new to excel just about finnished my ECDL L2 and i really liked the excel so i adventured to help out my familly new business by creating a set of diferent spreadsheets to database and more easy of managing all
some advise would be very much apreciated
could not post html print of my book due to addin not working with my current version of office 2010
i have created 3 macros so far in my workbook each of them doing a dif. thing ie:
1- print_and_sort ( filters the list then prints a copy with the items list with a value bigger than 0)
2- Stock_IN_update ( since i could not figure a function to do exactly what i wanted i recorded a macro to fetch 2 columns ( "Stock IN"and "Actual Stock" ) do a sum then copy total column cells and paste it back in "Actual Stock" as an update, then delete created sum columns and clear column "Stock IN"and input 0 value for next time.
here is macro code just in case i missed out something
Sub Stock_IN_update()
'
' Stock_IN_update Macro
'
'
Range("Table3[Stock IN]").Select
Selection.Copy
Sheets("ACTUAL STOCK").Select
Range("M2:M71").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("Table2[Actual Stock]").Select
Range("D71").Activate
Application.CutCopyMode = False
Selection.Copy
Range("L2:L71").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("K71").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=RC[1]+RC[2]"
Range("K71").Select
Selection.AutoFill Destination:=Range("K2:K71"), Type:=xlFillDefault
Range("K2:K71").Select
Range("K2").Select
ActiveWindow.SmallScroll Down:=-6
Range("K2:K71").Select
Selection.Copy
Range("Table2[Actual Stock]").Select
Range("D71").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("J2:N72").Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("stock updates").Select
Range("D2").Select
ActiveCell.FormulaR1C1 = "0"
Selection.AutoFill Destination:=Range("Table3[Stock IN]"), Type:= _
xlFillDefault
Range("Table3[Stock IN]").Select
Range("G73").Select
End Sub
3- Stock_OUT_update exaclty the same as "Stock_IN_update" macro but instead it subtracts
all macros run as a button
im prety new to excel just about finnished my ECDL L2 and i really liked the excel so i adventured to help out my familly new business by creating a set of diferent spreadsheets to database and more easy of managing all
some advise would be very much apreciated
could not post html print of my book due to addin not working with my current version of office 2010
Last edited: