Macro to Run Goal Seek and Grab Certain Info

jason8490

New Member
Joined
Aug 21, 2012
Messages
30
I have a macro that I recorded that grabs an Identifying ID pasts it into a sheet where it runs an XIRR then pasts that information back into another sheet. If the XIRR returns at 10% or more It should then run a Goal Seek to find out what it would take for the XIRR to be 10% or at most 10.001%. My question is how do I get the macro to continue running down a list of identifiers to run these functions and how do I tell it to run the goal seek if the XIRR returns at more then 10%. The list of IDs used for calculations will always change it'll never be the same count.

ID Sheet - Album on Imgur This is the sheet where the Identifier comes from and where I want the info after calculation pasted. Even if it doesn't hit 10% i still want information pasted back in this sheet.
Imgur: The most awesome images on the Internet This is the sheet where the XIRR and goal seek is done. F5 is the set cell, H5 is the value to change. Again I want to seek 10% or at most 10.001%




Code:
Sub Calc()'
' Calc Macro
'


'
    Range("A2").Select
    Selection.Copy
    Sheets("Sheet1").Select
    Range("D5").Select
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
        xlNone, SkipBlanks:=False, Transpose:=False
    Application.CutCopyMode = False
    Calculate
    Range("E5").Select
    Selection.Copy
    Sheets("LLID Dump").Select
    Range("B2").Select
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
        xlNone, SkipBlanks:=False, Transpose:=False
    Columns("B:B").EntireColumn.AutoFit
    Range("A3").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Sheet1").Select
    Range("E5").Select
    Range("D5").Select
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
        xlNone, SkipBlanks:=False, Transpose:=False
    Application.CutCopyMode = False
    Calculate
    Range("E5").Select
    Selection.Copy
    Sheets("LLID Dump").Select
    Range("B3").Select
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
        xlNone, SkipBlanks:=False, Transpose:=False
    Columns("B:B").EntireColumn.AutoFit
    Sheets("Sheet1").Select
    Range("F5").Select
    Application.CutCopyMode = False
    Range("F5").GoalSeek Goal:=0.10001, ChangingCell:=Range("H5")
    Selection.Copy
    Range("F5:J5").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("LLID Dump").Select
    Range("C3").Select
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
        xlNone, SkipBlanks:=False, Transpose:=False
End Sub
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,216,084
Messages
6,128,722
Members
449,465
Latest member
TAKLAM

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