View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jonco jonco is offline
external usenet poster
 
Posts: 53
Default Returning to the last sheet used

I might be trying to simplify this too much and that may be why it isn't
working. (Rewording my question)

I have a macro that manipulates data on a worksheet when a button is pushed
on that worksheet.

In that macro I want a line to store the worksheet name in case I need to go
back and change the data just entered.
Here is the code that is trying to store the sheet name:
LastCust = ActiveSheet.Name ' Stores the Active Sheets name in a
variable called LastCust

On another sheet (an Index Sheet) I have a button that I want to be able to
push if I need to change the last transaction I made on the customer's
sheet. Here is the code to recall that sheet and make it the active sheet
again (code in a different macro but in the same workbook). (It isn't
working):
Worksheets(LastCust).Activate ' Activates the worksheet that was saved
using the variable LastCust

Once activated (or selected) I can make the code make the changes I need.
I just can't get the proevious sheet activated again.

I'd like to be able to do this as simply as possible without using user
forms, and special add-ins and functions if possible.

As always, Thanks
Jonco