I've been running VBA on the Single spreadsheet successfully but am looking to move to the multiple so that I can keep markets in the sheet until they have closed.
How are you running VBA in this scenario, from every sheet or from the workbook/a module?
The problem I have is that I'm calling some Python from the VBA. In the Python on the single sheet I can then do something like:
Code: Select all
import xlwings as xw
def myfunction():
wb = xw.Book.Caller()
wb.sheets['Bet Angel']['A1'] = "foo"
I've been looking for a way to dynamically get the name of the sheet that is running the VBA (and just have my VBA on each sheet), with something like:
Code: Select all
Application.Caller.Worksheet.Name
Could the Workbook_SheetChange method be an option? Any pointers much appreciated.
Thanks, Rich