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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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