I'm a total VBA noob but for the workbook I'm making VBA seemed like the only thing that to get rid of the manual processes. I can't seem to find exactly how I would create or add something like this into my code.
What I am doing: Running XIRR on hundred plus items. I built a sheet that runs XIRR on just one item. I have a macro (see below) that loops through a list of Identifiers on one sheet and plugs them into my XIRR sheet (Don't want to run XIRR on all items at once because of calc speed). After it plugs in the Identifier and calculates it grabs the information and pastes it back into my Identifier list.
What I want to do: I want to add into my macro if possible or if easier create another macro to run a goal seek function. The thing is I only want it run if the XIRR returns at 10% or more. Then return that information and paste it back into my Identifier Dump.
Goal Seeks are finicky as is, so sometimes I have to adjust the "changing cell" to get exactly 10% back.
What I am doing: Running XIRR on hundred plus items. I built a sheet that runs XIRR on just one item. I have a macro (see below) that loops through a list of Identifiers on one sheet and plugs them into my XIRR sheet (Don't want to run XIRR on all items at once because of calc speed). After it plugs in the Identifier and calculates it grabs the information and pastes it back into my Identifier list.
What I want to do: I want to add into my macro if possible or if easier create another macro to run a goal seek function. The thing is I only want it run if the XIRR returns at 10% or more. Then return that information and paste it back into my Identifier Dump.
Goal Seeks are finicky as is, so sometimes I have to adjust the "changing cell" to get exactly 10% back.
Code:
Range("F5").GoalSeek Goal:=0.1, ChangingCell:=Range("H5")
Code:
Sub XIRR3()'
' XIRR3 Macro
'
'
' Select cell A2, *first line of data*.
Do Until IsEmpty(ActiveCell)
Selection.Copy
Sheets("Sheet1").Select
Range("D5").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Calculate
Range("E5:J5").Select
Selection.Copy
Sheets("LLID Dump").Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveCell.Offset(1, -1).Range("A1").Select
Loop
End Sub
Last edited: