Insert New Sheet De-activates Current Sheet VBA Workaround?
Set prior = ActiveSheet
With Worksheets.Add
'run your code on added sheet
End With
prior.Activate
Gord Dibben MS Excel MVP
On Tue, 29 Jul 2008 16:33:01 -0700, facmanboss
wrote:
When I insert a new sheet in a workbook, there are some things I do to it via
VBA code before it finishes activating. However, I would like to restore the
sheet that was active PRIOR to the insert as the active one after the new
sheet finishes it's setup. The events available in Excel don't seem amenable
to this. How can I do this with VBA code?
Thanks in advance,
facmanboss
|