Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Maintain view of a sheet while macro runs

I have a sheet named Menu that contains command buttons the user will
choose from. I would like for the view to stay on Menu as the macro
executes. Is there a way to keep the focus on this sheet? Here's an
example of one of the button commands.


Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and choose from Current or Deleted
sheet.

'Unhides columns for Search
Application.Goto Reference:="_2nd_PO_PL"
ActiveCell.Columns("A:N").EntireColumn.Select
Selection.EntireColumn.Hidden = False

' user will enter PO# to search for
UserForm12.Show

End Sub

Thanks,
J.O.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Maintain view of a sheet while macro runs

at the beginning of your macro, add

application.screenupdating=false

and near the bottom add

application.screenupdating=true

then the screen won't jump around following your macro. will just
stay on the Menu sheet.
hth!
susan


On Feb 28, 9:07 am, "excelnut1954" wrote:
I have a sheet named Menu that contains command buttons the user will
choose from. I would like for the view to stay on Menu as the macro
executes. Is there a way to keep the focus on this sheet? Here's an
example of one of the button commands.

Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and choose from Current or Deleted
sheet.

'Unhides columns for Search
Application.Goto Reference:="_2nd_PO_PL"
ActiveCell.Columns("A:N").EntireColumn.Select
Selection.EntireColumn.Hidden = False

' user will enter PO# to search for
UserForm12.Show

End Sub

Thanks,
J.O.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Maintain view of a sheet while macro runs

Sure, don't write code that goes to the other sheet

Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and
'choose from Current or Deleted sheet.

'Unhides columns for Search
Application.Range("_2nd_PO_PL") _
.Columns("A:N").EntireColumn.Hidden = False

UserForm12.Show

End Sub

"excelnut1954" wrote:

I have a sheet named Menu that contains command buttons the user will
choose from. I would like for the view to stay on Menu as the macro
executes. Is there a way to keep the focus on this sheet? Here's an
example of one of the button commands.


Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and choose from Current or Deleted
sheet.

'Unhides columns for Search
Application.Goto Reference:="_2nd_PO_PL"
ActiveCell.Columns("A:N").EntireColumn.Select
Selection.EntireColumn.Hidden = False

' user will enter PO# to search for
UserForm12.Show

End Sub

Thanks,
J.O.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Maintain view of a sheet while macro runs

<sigh
tom - every time you come along behind me, i know i've either not
answered the question properly OR completely. or in this case, i
answered the question but didn't address the problem.
but it helps me learn, too.
susan

On Feb 28, 10:00 am, Tom Ogilvy
wrote:
Sure, don't write code that goes to the other sheet

Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and
'choose from Current or Deleted sheet.

'Unhides columns for Search
Application.Range("_2nd_PO_PL") _
.Columns("A:N").EntireColumn.Hidden = False

UserForm12.Show

End Sub



"excelnut1954" wrote:
I have a sheet named Menu that contains command buttons the user will
choose from. I would like for the view to stay on Menu as the macro
executes. Is there a way to keep the focus on this sheet? Here's an
example of one of the button commands.


Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and choose from Current or Deleted
sheet.


'Unhides columns for Search
Application.Goto Reference:="_2nd_PO_PL"
ActiveCell.Columns("A:N").EntireColumn.Select
Selection.EntireColumn.Hidden = False


' user will enter PO# to search for
UserForm12.Show


End Sub


Thanks,
J.O.- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Maintain view of a sheet while macro runs

I think you assume to much as to my motives relative to your suggestion.
Where I am posting, you came along after me by 14 minutes. It seems that
what is shown as time isn't universal - so best to assume that any posts made
within probably an hour were done without knowledge of other answers/posts
(unless, they are children within a single thread). Remember that posts are
made to servers all over the world and migrated in a rather informal fashion.

--
Regards,
Tom Ogilvy




"Susan" wrote:

<sigh
tom - every time you come along behind me, i know i've either not
answered the question properly OR completely. or in this case, i
answered the question but didn't address the problem.
but it helps me learn, too.
susan

On Feb 28, 10:00 am, Tom Ogilvy
wrote:
Sure, don't write code that goes to the other sheet

Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and
'choose from Current or Deleted sheet.

'Unhides columns for Search
Application.Range("_2nd_PO_PL") _
.Columns("A:N").EntireColumn.Hidden = False

UserForm12.Show

End Sub



"excelnut1954" wrote:
I have a sheet named Menu that contains command buttons the user will
choose from. I would like for the view to stay on Menu as the macro
executes. Is there a way to keep the focus on this sheet? Here's an
example of one of the button commands.


Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and choose from Current or Deleted
sheet.


'Unhides columns for Search
Application.Goto Reference:="_2nd_PO_PL"
ActiveCell.Columns("A:N").EntireColumn.Select
Selection.EntireColumn.Hidden = False


' user will enter PO# to search for
UserForm12.Show


End Sub


Thanks,
J.O.- Hide quoted text -


- Show quoted text -






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Maintain view of a sheet while macro runs

yes, i've noticed that problem timing when an "answer" appears
before the "question." i hadn't considered that in this situation.

but please understand i wan't at all trying to imply that you are
following me around correcting me on purpose! :) it's just kind of
funny - & you have so much more experience than me. so your answers
are generally either more thorough or have a better understanding of
what the OP wanted/asked.
susan



On Feb 28, 11:07 am, Tom Ogilvy
wrote:
I think you assume to much as to my motives relative to your suggestion.
Where I am posting, you came along after me by 14 minutes. It seems that
what is shown as time isn't universal - so best to assume that any posts made
within probably an hour were done without knowledge of other answers/posts
(unless, they are children within a single thread). Remember that posts are
made to servers all over the world and migrated in a rather informal fashion.

--
Regards,
Tom Ogilvy



"Susan" wrote:
<sigh
tom - every time you come along behind me, i know i've either not
answered the question properly OR completely. or in this case, i
answered the question but didn't address the problem.
but it helps me learn, too.
susan


On Feb 28, 10:00 am, Tom Ogilvy
wrote:
Sure, don't write code that goes to the other sheet


Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and
'choose from Current or Deleted sheet.


'Unhides columns for Search
Application.Range("_2nd_PO_PL") _
.Columns("A:N").EntireColumn.Hidden = False


UserForm12.Show


End Sub


"excelnut1954" wrote:
I have a sheet named Menu that contains command buttons the user will
choose from. I would like for the view to stay on Menu as the macro
executes. Is there a way to keep the focus on this sheet? Here's an
example of one of the button commands.


Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and choose from Current or Deleted
sheet.


'Unhides columns for Search
Application.Goto Reference:="_2nd_PO_PL"
ActiveCell.Columns("A:N").EntireColumn.Select
Selection.EntireColumn.Hidden = False


' user will enter PO# to search for
UserForm12.Show


End Sub


Thanks,
J.O.- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Maintain view of a sheet while macro runs

Now I am commenting on/supplementing your post. That is true if he had
returned to menu in his code, then turned screenupdating on, but he didn't.
So to utilize your suggestion, he should.

--
Regards,
Tom Ogilvy


"Susan" wrote:

at the beginning of your macro, add

application.screenupdating=false

and near the bottom add

application.screenupdating=true

then the screen won't jump around following your macro. will just
stay on the Menu sheet.
hth!
susan


On Feb 28, 9:07 am, "excelnut1954" wrote:
I have a sheet named Menu that contains command buttons the user will
choose from. I would like for the view to stay on Menu as the macro
executes. Is there a way to keep the focus on this sheet? Here's an
example of one of the button commands.

Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and choose from Current or Deleted
sheet.

'Unhides columns for Search
Application.Goto Reference:="_2nd_PO_PL"
ActiveCell.Columns("A:N").EntireColumn.Select
Selection.EntireColumn.Hidden = False

' user will enter PO# to search for
UserForm12.Show

End Sub

Thanks,
J.O.




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Maintain view of a sheet while macro runs

On Feb 28, 10:19 am, Tom Ogilvy
wrote:
Now I am commenting on/supplementing your post. That is true if he had
returned to menu in his code, then turned screenupdating on, but he didn't.
So to utilize your suggestion, he should.

--
Regards,
Tom Ogilvy



"Susan" wrote:
at the beginning of your macro, add


application.screenupdating=false


and near the bottom add


application.screenupdating=true


then the screen won't jump around following your macro. will just
stay on the Menu sheet.
hth!
susan


On Feb 28, 9:07 am, "excelnut1954" wrote:
I have a sheet named Menu that contains command buttons the user will
choose from. I would like for the view to stay on Menu as the macro
executes. Is there a way to keep the focus on this sheet? Here's an
example of one of the button commands.


Private Sub CommandButton1_Click()
'Find Record via PO# - enter # and choose from Current or Deleted
sheet.


'Unhides columns for Search
Application.Goto Reference:="_2nd_PO_PL"
ActiveCell.Columns("A:N").EntireColumn.Select
Selection.EntireColumn.Hidden = False


' user will enter PO# to search for
UserForm12.Show


End Sub


Thanks,
J.O.- Hide quoted text -


- Show quoted text -


Works great! So simple, yet so effective.
I appreaciate the help, no matter who it comes from.
Thanks Susan & Tom
J.O.

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
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs Rruffpaw Setting up and Configuration of Excel 1 September 17th 11 01:25 PM
Why macro runs on the same sheet? Harshad[_2_] Excel Discussion (Misc queries) 1 September 15th 08 09:39 AM
One macro runs then it auto runs another macro PG Excel Discussion (Misc queries) 2 September 1st 06 09:30 PM
Why is Sheet deleted when Macro runs... Darin Kramer Excel Programming 3 April 11th 06 02:50 PM
Macro to View Protected Sheet Glenn Excel Programming 1 January 28th 04 06:21 PM


All times are GMT +1. The time now is 12:21 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"