Return to Original Workbook
Public Sub StandardsDates()
'Standards Dates
ActiveSheet.Unprotect
Workbooks.Open Filename:="\OriginalName&Path.xls"
Range("StartPoint.EndPoint").Select 'Copy Original Range Data
Selection.Copy
ActiveWindow.ActivateNext 'Select New Workbook
Range("StartPoint:EndPoint").Select 'Paste Original Range Data to new
Workbook
ActiveSheet.Paste
ActiveWindow.ActivatePrevious 'Select & Close Original Workbook
Application.CutCopyMode = False
ActiveWindow.Close
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
I use this to copy €œTest Equipment Nomenclatures:CalibrationDates from an
existing workbook into a new one. If I understand what you are asking a
little modification will make it fill your needs
Lou
"Dave Peterson" wrote:
Dim mySelection as range
Dim myActCell as Range
set myActcell = activecell
set mySelection = selection
'do lots of stuff
application.goto mySelection
myActcell.activate
ajvasel wrote:
I feel like I'm missing the answer to a pretty simple question, but I have
not been able to find any other threads related to this.
In the program that I am working on, I run a series of sub routines that
copy data from the original workbook to a new workbook. After I run each sub,
I need to be able to come back (or activate, I guess) to the original
workbook before I call the next sub.
I tried naming the original workbook
Dim RunRateMain As Workbook
and then re-activating it after I ran the first of the series of the subs,
but that didn't seem to work
Any help would be appreciated...
--
Dave Peterson
|