VBAMePlease
Board Regular
- Joined
- Jun 19, 2017
- Messages
- 59
Code:
Private Sub CommandButton2_Click()If MsgBox("Capacity Payment Structure Up-to-date?", vbQuestion + vbYesNo) <> vbYes Then Run
Range("D4").Select
Selection.Copy
Sheets("Rate Analysis").Select
Range("L40").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Results").Select
Range("C16").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L26").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Results").Select
Range("D16").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L27").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Call Macro Run_BR_Query
Range("P28").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Results").Select
Range("E16").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Analysis").Select
Application.CutCopyMode = False
Call Macro Clear_Results
Range("C17").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L26").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Results").Select
Range("D17").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L27").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Call Macro Run_BR_Query
Range("P28").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Results").Select
Range("E17").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Analysis").Select
Application.CutCopyMode = False
Call Macro Clear_Results
Range("C18").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L26").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Results").Select
Range("D18").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L27").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Call Macro Run_BR_Query
Range("P28").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Results").Select
Range("E18").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Analysis").Select
Application.CutCopyMode = False
Call Macro Clear_Results
Range("C19").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L26").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Results").Select
Range("D19").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L27").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Call Macro Run_BR_Query
Range("P28").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Results").Select
Range("E19").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Analysis").Select
Application.CutCopyMode = False
Call Macro Clear_Results
Range("C20").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L26").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Results").Select
Range("D20").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L27").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Call Macro Run_BR_Query
Range("P28").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Results").Select
Range("E20").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Analysis").Select
Application.CutCopyMode = False
Call Macro Clear_Results
Range("C21").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L26").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Results").Select
Range("D21").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Rate Analysis").Select
Range("L27").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Call Macro Run_BR_Query
Range("P28").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Results").Select
Range("E20").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Rate Analysis").Select
Application.CutCopyMode = False
Essentially how can I get this to run all of the values in C19 and D19 down to C125 and D125 through the "Run_BR_Query" macro and copy the results for each iteration into the "Results" sheet in E19...
Happy to provide more context here for anyone who would prefer it.
Thanks.