Hi All,
Hope someone can assist with my macro.
The macro is currently copying the cost-effectiveness probabilities (seen in columns Range("DF14:DI14")) instead of linking it to the WTP at each amount from 0GBP to 50,000GBP (listed in the rows D15: D65) to yield Cost-effectiveness Acceptability Curve (CEAC) per drug (DQ15:DT65).
I need to generate a CEAC that shows which healthcare intervention is most cost-effective.
Currently the macro is copying each of the cost-effectiveness probabilities (seen in columns Range("DF14:DI14")) and generating the same value per CEAC column for each healthcare intervention.
Struggling to attache the excel file with the data...
Below is my macro for the CEAC:
Sub RunCEAC()
'
' Macro for running the CEAC
'
'Create new variables for Willingess to Pay (WTP) and Cost-effectiveness probabilities
Dim Willingness_to_Pay__WTP As Double
Dim CE_Probabilities As Double
Sheets("PSA_&_EVPI").Select
'Do 51 times for all WTP
For i = 1 To 51
'Copy new WTP
WTP = Cells(14 + i, 118)
Range("DN7").Value = WTP
'Copy CE_Probabilities to the column
CE_Probabilities = Range("DF7")
Cells(14 + i, 121).Value = CE_Probabilities
CE_Probabilities = Range("DG7")
Cells(14 + i, 122).Value = CE_Probabilities
CE_Probabilities = Range("DH7")
Cells(14 + i, 123).Value = CE_Probabilities
CE_Probabilities = Range("DI7")
Cells(14 + i, 124).Value = CE_Probabilities
Next i
End Sub
Bookmarks