I have an Excel workbook containing named variables across several worksheets. In one of these worksheets I have a "run solver" button, which kicks off a VBA routine. The first thing this routine does is allocate values of variables picked up from the workbook to local variables inside the VBA routine. I am using syntax as per the following example:
Private Sub RunSolver_Click()
Dim x As Double
x = Range("fred").Value
...
End Sub
This works fine PROVIDED the workbook variable 'fred' is in the same worksheet as the "run solver" button. However, I can't work out how to access variables from other worksheets in the same workbook. Any suggestions?