Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0613· OpenAIAi2 WildChat-4.8M (AI2)

Vlookupresultmin.append("=VLOOKUP(LEFT(RIGHT(B" + str(1 + i) +…

  1. User

    Vlookup_result_min.append("=VLOOKUP(LEFT(RIGHT(B" + str(1 + i) + ",7),4),'[CaseR-ZHH.xls]CASE1-某月方案测算'!A:A:Q,6,FALSE)") 用python修改代码,把“CASE1-某月方案测算”作为变量,变量由下拉框获取,请给出python代码

  2. Assistant

    Sure! Here is the Python code that incorporates a variable for the worksheet name retrieved from a dropdown box:

    worksheet_name = dropdown_box.get()  # Assuming 'dropdown_box' is the name of your dropdown box widget
    
    Vlookup_result_min.append("=VLOOKUP(LEFT(RIGHT(B" + str(1 + i) + ",7),4),'[CaseR-ZHH.xls]" + worksheet_name + "'!$A:$Q,6,FALSE)")
    

    In the above code, dropdown_box.get() retrieves the selected value from the dropdown box, which is then assigned to the worksheet_name variable. The worksheet_name variable is then used in constructing the VLOOKUP formula by concatenating it within the formula string.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.