Macro reliability on excel??

proTObe

New Member
Joined
Jun 6, 2011
Messages
4
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
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
So, what is your question, then?
 
Upvote 0
Also, use F8 to step through the following macro. It should not be too far from your version of the same macro:

Code:
Sub Stock_IN_update()

    Sheets("ACTUAL STOCK").Range("M2:M71").Value = Range("Table3[Stock IN]").Value
    Range("L2:L71").Value = Range("Table2[Actual Stock]").Value
    
    With Range("K2:K71")
        .Formula = "=RC[1]+RC[2]"
        Range("Table2[Actual Stock]").Value = .Value
    End With
    
    Range("J2:N72").ClearContents
    Sheets("stock updates").Range("Table3[Stock IN]").Value = 0
    
End Sub

Wigi
 
Upvote 0
thx for replying

my question is ...

1- should i keep it as a macro ? how reliable is it to do that job all the time
2- is there a simple function to do same job dynamic ?
3 - maybe a vba ( not sure what it does yet )

just looking at how to improve it better
 
Upvote 0
thx for replying

my question is ...

1- should i keep it as a macro ? how reliable is it to do that job all the time
2- is there a simple function to do same job dynamic ?
3 - maybe a vba ( not sure what it does yet )

just looking at how to improve it better

1- yes, but then a macro that is written, not recorded with the macro recorder.
2- probably not, although I did not investigate it into detail
3- VBA and macros are the same
 
Upvote 0
hummm
great so i can trust on macros more

unfortunetly i can not hard code a macro alone, like i sayed my knowledge is very limited but im willing to learn anything that i can.

so when should i use a macro or a vba ?



again thx for ur help
 
Upvote 0
so when should i use a macro or a vba ?

When you are automating tasks, just as now. It just simplies / speeds up working in Excel in a certain workbook or workbooks.

Again, macros and VBA are the same.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,758
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top