VBAMePlease
Board Regular
- Joined
- Jun 19, 2017
- Messages
- 59
Okay, following macro for whatever reason seems to not be running the Macro I have embedded in it. It is only copying the values that exist in P28:AN28 before I execute the script.
So if all the values were $50, the macro would simply copy these values over. If the values were all 0, it only copies all 0's.
Here is the first macro:
Here is "Run_BR_Query"
Am I doing something wrong with my loop in the first macro where it isn't running "Run_BR_Query"?
I know that "Run_BR_Query" works accurately. For whatever reason, it seems like the first macro isn't running this script. I can post examples if need be.
So if all the values were $50, the macro would simply copy these values over. If the values were all 0, it only copies all 0's.
Here is the first macro:
Code:
If MsgBox("Capacity Payment Structure Up-to-date?", vbQuestion + vbYesNo) <> vbYes Then Run
If MsgBox("This will take significant memory and may take up to 10 minutes to compute depending upon the number of sub-markets.", vbQuestion + vbOKCancel) <> vbOK Then Run
Application.ScreenUpdating = False
lCol = Worksheets("Rate Analysis").Cells(28, Columns.Count).End(xlToLeft).Column
Worksheets("Rate Analysis").Range("L40").Value = Sheets("Dashboard").Range("D4").Value
For i = 16 To 20
With Worksheets("Rate Analysis")
.Range("C" & i).Copy
Sheets("Results").Range("L26").PasteSpecial Paste:=xlPasteValues
.Range("D" & i).Copy
Sheets("Results").Range("L27").PasteSpecial Paste:=xlPasteValues
End With
Call Run_BR_Query
Sheets("Rate Analysis").Range("P28:" & Cells(28, lCol).Address).Copy
Sheets("Results").Range("E" & i & ":" & Cells(i, lCol - 11).Address).PasteSpecial Paste:=xlPasteValues
Next i
Application.ScreenUpdating = True
Here is "Run_BR_Query"
Code:
Dim c As CurrencyApplication.ScreenUpdating = False
c = 15
Do Until c = 40
c = c + 1
Cells(26, c).Copy
Cells(19, 5).PasteSpecial Paste:=xlPasteValues
Cells(27, 5).Copy
Cells(29, c).PasteSpecial Paste:=xlPasteValues
Range(Cells(30, 4), Cells(41, 4)).Copy
Cells(30, c).PasteSpecial Paste:=xlPasteValues
Loop
Application.ScreenUpdating = True
Am I doing something wrong with my loop in the first macro where it isn't running "Run_BR_Query"?
I know that "Run_BR_Query" works accurately. For whatever reason, it seems like the first macro isn't running this script. I can post examples if need be.