View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Sheet name problem

Try:

Dim wsLastSheet As Worksheet

Set wsLastSheet = ActiveSheet
'Do your chart stuff here
wsLastSheet.Activate



In article ,
"NathanG" wrote:

I am developing a system where charts are used to display data. Two or more
sheets within the system can go to the a chart. The problem is that I cannot
get the back button to go to the previous sheet on which the user was on. I
have copied the chart sheets to change the code but this does not solve the
problem as new sheets are created with different sheet names so there is no
way to no future sheet names. Is there a way of remembering the sheet before
going to a chart and then being able to return the previous sheet.

I dimed a variable called lastsheet and tried activesheet=lastsheet but I
couldn't get the back button to recognise lastsheet as a sheetname.