I am very new to macro so this may be a simple fix, hopefully.
The function below (IRRPaybacks123) works perfectly for the first row however I cannot get it to repeat throughout the table.
I have attempted to get it to do in the first Sub LoopAttempt123 but I am missing something
Any and all suggestions greatly appreciated
The function below (IRRPaybacks123) works perfectly for the first row however I cannot get it to repeat throughout the table.
I have attempted to get it to do in the first Sub LoopAttempt123 but I am missing something
Any and all suggestions greatly appreciated
VBA Code:
Sub LoopAttempt123()
'
' LoopAttempt123 Macro
'
' Keyboard Shortcut: Ctrl+i
'
Dim Table As Range
Set Table = Range("A2", Range("A2").End(xlToRight).End(xlDown))
For Each Row In Table.Rows
End Sub
Function IRRPaybacks123()
Sheets("New Data").Select
Range("b2").Select
Selection.Copy
Sheets("IRR Format").Select
Range("I5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("D6").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "='New Data'!R[-4]C[-1]"
Range("D6").Select
Selection.Copy
Range("D7:D8").Select
ActiveSheet.Paste
Range("E6").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "='New Data'!R[-4]C"
Range("H6").Select
ActiveCell.FormulaR1C1 = "='New Data'!R[-4]C[-2]"
Range("H6").Select
Selection.Copy
Range("H7:H8").Select
ActiveSheet.Paste
Range("K10").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("New Data").Select
Range("H2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Style = "Percent"
Sheets("IRR Format").Select
Range("L10").Select
Selection.Copy
Sheets("New Data").Select
Range("I2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "0.000000"
Selection.NumberFormat = "0.00000"
Selection.NumberFormat = "0.0000"
Selection.NumberFormat = "0.000"
Selection.NumberFormat = "0.00"
Selection.NumberFormat = "0.0"
Selection.NumberFormat = "0"
Range("J5").Select
Sheets("IRR Format").Select
Range("D6:F8").Select
Selection.ClearContents
Range("H5:I8").Select
Selection.ClearContents
Sheets("New Data").Select
End Function