Hi,
for some reason I can not do this because I am new to VBA. How can I get a chart reference be made available in a userform?
I know module's is where you would want to declare global variables, but I still have a problem there.
In my spreadsheet:
VB Code:
Private sub transferChart() Sheets("Sheet1").ChartObjects("Chart 1").Activate Call toModule(ActiveChart) End Sub
In Module:
VB Code:
Public Function toModule(ByVal mychart As Chart) chartA = mychart End Function 'userform would call this function to get the chart reference from spreadsheet Public Function returnChart() As Chart returnChart = chartA End Function
this way seems kind of tedious. Is there another way, becuase this one isn't working.




Reply With Quote