+ Reply to Thread
Results 1 to 2 of 2

Macro not working - Cost-effectiveness Acceptability Curve (CEAC)

  1. #1
    Registered User
    Join Date
    05-08-2020
    Location
    UK
    MS-Off Ver
    2016
    Posts
    0

    Macro not working - Cost-effectiveness Acceptability Curve (CEAC)

    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
    Last edited by Buhntle; 05-08-2020 at 08:16 PM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166
    Hello Buhntle,

    Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1