Hi All,
Ive recorded the following macro which does the function I wanted. I know that excel adds a lot of useless lines when you do this and since im trying to learn VBA, everytime I code something I try to learn and understand the code. So basically all it does is go to a specific tab and calculate something based on two columns then copy and pastes it in another tab in value form, goes back to the old tab and delete the column whee you originally calculated. However as I mentioned VBA recorder seems to add of useless lines, for me to understand it better does anyone know the below code written in its simplest format? Thnaks in advance.
Sheets("BIG Report").Select
Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-12]-RC[-14]"
Range("Q6").Select
Selection.AutoFill Destination:=Range("Q6:Q55"), Type:=xlFillDefault
Range("Q6:Q55").Select
Selection.Copy
Sheets("REPORT D-2").Select
Range("E6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("G13").Select
Sheets("BIG Report").Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("REPORT D-2").Select
Range("F21").Select
Ive recorded the following macro which does the function I wanted. I know that excel adds a lot of useless lines when you do this and since im trying to learn VBA, everytime I code something I try to learn and understand the code. So basically all it does is go to a specific tab and calculate something based on two columns then copy and pastes it in another tab in value form, goes back to the old tab and delete the column whee you originally calculated. However as I mentioned VBA recorder seems to add of useless lines, for me to understand it better does anyone know the below code written in its simplest format? Thnaks in advance.
Sheets("BIG Report").Select
Range("Q6").Select
ActiveCell.FormulaR1C1 = "=RC[-12]-RC[-14]"
Range("Q6").Select
Selection.AutoFill Destination:=Range("Q6:Q55"), Type:=xlFillDefault
Range("Q6:Q55").Select
Selection.Copy
Sheets("REPORT D-2").Select
Range("E6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("G13").Select
Sheets("BIG Report").Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("REPORT D-2").Select
Range("F21").Select