我是VBA编码的新手,并不擅长调试错误。 我最近遇到了这个错误,我的编码具有简单的文本框到单元代码。 按下添加按钮(将文本框上的数据输入到当前单元格)后,我不断收到此运行时错误(运行时错误'2147417848(80010108)':对象'范围'的方法'值'失败)和我的Excel (v2013)将关闭/尝试恢复。
def main():
option=displaymenu()
print(option)
while option1 != 4:
if option1 ==1:
print("1234")
elif option1==2:
print("1")
elif option1==3:
print("joe")
else:
print("end")
def displaymenu():
print("choose one of the following options")
print("1.Calculate x to the power of N") << this is supposed to be
print("2.Calculate factorial of N")
print("3.Calculate EXP")
print("4.Exit")
option1=input("Please enter your choice here:")<<< i want these print statements to act as a menu? how do I make it so when I input a number 1-4 It does this operation I input ?