Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Making a macro return to spreadsheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Snoopy - 29 Jun 2007 14:44 GMT
Hi fellows
My workbook is design to collect data from local files an put them
together as a "bigger" database. A number of spreadsheets in this
workbook contain each one single specific pivottable that reports on
its unique predesigned layout. By activating the same macro - using a
commandbutton on each spreadsheet (e.g pivot-table) all pivot-tables
updates.
My problem is to make the macro return to the spreadsheet from where
it was activated - and not expire on the last activated range/
spreadsheet.

My mission is not completed until this nagging problem is solved.

Will anybody kindly lead me out of this darkness and put some light in
to my Excel-VBA-life?

Loving regards
Snoopy
Billy Liddel - 29 Jun 2007 14:54 GMT
Hi Snoopy

Somewhere at the top of the routine insert

shtName = activeworkbook.name

and at the end put

sheets(shtname).select

Regards
Peter

> Hi fellows
> My workbook is design to collect data from local files an put them
[quoted text clipped - 14 lines]
> Loving regards
> Snoopy
Snoopy - 29 Jun 2007 15:03 GMT
On 29 Jun, 15:54, Billy Liddel <BillyLid...@discussions.microsoft.com>
wrote:
> Hi Snoopy
>
[quoted text clipped - 29 lines]
>
> - Vis sitert tekst -

Thanks Peter, but the macro crashes on the "sheets(shtname).select" in
the end. What can be wrong?
Dave Peterson - 29 Jun 2007 17:27 GMT
Dim myOrigRng as range

set myorigrng = selection
'do lots of things
application.goto myorigrng

May work for you.

> Hi fellows
> My workbook is design to collect data from local files an put them
[quoted text clipped - 14 lines]
> Loving regards
> Snoopy

Signature

Dave Peterson

Snoopy - 02 Jul 2007 07:01 GMT
> Dim myOrigRng as range
>
[quoted text clipped - 30 lines]
>
> - Vis sitert tekst -

Dave
Fabulous!
You made the sun shine on a very rainy day

Regards
Snoopy

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.