re-create macro

ehsas

Board Regular
Joined
Sep 17, 2002
Messages
200
I have recorded a macro as follow which i need to make as real macro.Could anyone help.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 09/22/2002

' Keyboard Shortcut: Ctrl+m
'
ActiveCell.FormulaR1C1 = "16-Jan-1999"
Range("B8").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],Sheet2!R3C1:R31C5,1,0)"
Range("C8").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],Sheet2!R3C1:R31C5,3,0)"
Range("D8").Select
ActiveCell.FormulaR1C1 = "=vllokup(RC[-3],Sheet2!R3C1:R31C5,4,0)"
Range("D8").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],Sheet2!R3C1:R31C5,5,0)"
Range("A8:D8").Select
Selection.AutoFill Destination:=Range("A8:D1330"), Type:=xlFillDefault
Range("A8:D1330").Select
Range("F8").Select
ActiveCell.FormulaR1C1 = "=MAX(0,RC[-5]-RC[-1]+1)"
Range("F8").Select
Selection.AutoFill Destination:=Range("F8:F1330"), Type:=xlFillDefault
Range("F8:F1330").Select

Range("G8").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1],R3C7*(R2C7*INDEX({1,2,3},MATCH(RC[-1],{0,32,62}))),0)"
Range("G8").Select
Selection.AutoFill Destination:=Range("G8:G1330"), Type:=xlFillDefault
Range("G8:G1330").Select

Range("H8").Select
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("H9").Select
ActiveCell.FormulaR1C1 = "=RC[-1]+R[-1]C"
Range("H9").Select
Selection.AutoFill Destination:=Range("H9:H1330"), Type:=xlFillDefault
Range("H9:H1330").Select
End Sub
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,181,645
Messages
5,931,200
Members
436,782
Latest member
talhafiaz

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
Top