Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default return to original sheet


well........ you can do it one of two ways.
one is to add
(untested syntax but theory is correct!)

dim myPage as worksheet

set myPage = activeworksheet
application.screenupdating=false

before your code, and at the end, add

myPage.select
application.screenupdating=true

this way it would do everything you want it to do, without you
seeing that it's moving around. this is untested & i've just spent
the last 10 minutes trying to get the stupid concept to work!!!!!
will keep trying in case you can't do it, either! (grrrrr!).

the other way would be to learn to eliminate the "selects" in
your code. you can't do this by recording, because the re-
corder ALWAYS "selects" things in order to work with them.
hope this helps!
susan



On Jan 24, 10:34 am, enyaw wrote:
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 23/01/2007 by GX
'

Sheets("Summary").Select
Range("A38:C51").Select
Selection.Copy
Range("E38").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.sort Key1:=Range("G38"), Order1:=xlDescending,
Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

This is my code that is run when changes are made to a sheet. I have a
sheet for each day of the month and a summary sheet at the end of the month.
When the values are entered into to the days sheets it goes into the summary
sheet and this macro runs. The problem is i want the macro to run when the
info is entered but i also want to stay on the sheet i am on. Can anyone
help?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to return to original cell Tonso Excel Discussion (Misc queries) 1 April 1st 10 02:48 AM
Hyperlink to web does not return to original Excel worksheet g. spence Excel Discussion (Misc queries) 1 November 23rd 07 05:04 PM
Return to Original Workbook ajvasel Excel Programming 12 August 10th 06 03:32 AM
Return WB to original state Ronbo Excel Programming 3 January 13th 06 11:47 AM
Return to Original File Stephen[_11_] Excel Programming 2 April 22nd 04 12:24 PM


All times are GMT +1. The time now is 07:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"