Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Select a sheet and return

I need something that will select cell A1 on the sheet named Holiday and
then return me to the sheet that was active when the code was run. It must
go to and select A1 on the Holiday sheet,

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Select a sheet and return

This macro will do what you asked...

Sub SelectA1OnHolidaySheet()
Dim WS As Worksheet
Set WS = ActiveSheet
On Error GoTo CleanUp
Application.ScreenUpdating = False
Worksheets("Holiday").Activate
Worksheets("Holiday").Range("A1").Select
WS.Activate
CleanUp:
Application.ScreenUpdating = True
End Sub

But I am curious... why do you think you need to do this?

--
Rick (MVP - Excel)


"Patrick C. Simonds" wrote in message
...
I need something that will select cell A1 on the sheet named Holiday and
then return me to the sheet that was active when the code was run. It must
go to and select A1 on the Holiday sheet,


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select a sheet and return


Generally you do not need to select a cell or worksheet in order to
manipulate it or retrieve data, selecting can have an adverse effect on
performance when you have large sheets or a lot of data.


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30124

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Select a sheet and return

I know that, which is why I asked the OP the question...

"But I am curious... why do you think you need to do this?"

--
Rick (MVP - Excel)


"The Code Cage Team" wrote in
message ...

Generally you do not need to select a cell or worksheet in order to
manipulate it or retrieve data, selecting can have an adverse effect on
performance when you have large sheets or a lot of data.


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile:
http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30124


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select a sheet and return


Rick, that wasn't aimed at you :)
I think the OP may be using something like:
Sheets("Holidays").Activecell.Value
Which of course serves no purpose or maybe the OP is forcing the select
hoping it may follow a hyperlink there....shots in the dark i know, and
yes it was an odd request.


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30124



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Select a sheet and return

Could be the OP was trying to do the select in one line without first
activating the sheet and kept getting an error message. Probably just wanted
to know how to get it to select A1 from another sheet.

"The Code Cage Team" wrote:


Rick, that wasn't aimed at you :)
I think the OP may be using something like:
Sheets("Holidays").Activecell.Value
Which of course serves no purpose or maybe the OP is forcing the select
hoping it may follow a hyperlink there....shots in the dark i know, and
yes it was an odd request.


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30124


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
Select text before carriage return jellyroller Excel Discussion (Misc queries) 3 April 26th 23 11:44 AM
VBA: Column Select then Data Select then return to cell A1 James C[_2_] Excel Discussion (Misc queries) 3 February 1st 10 11:35 AM
Macro to Return Row, then move over and select up to Karin Excel Discussion (Misc queries) 8 October 9th 09 09:34 PM
Select sheet, Pause till Enter pressed, return to previous sheet Russ3Z Excel Programming 1 June 12th 07 11:06 PM
Select Minimum value and return the name of the supplier Mark McDonough Excel Worksheet Functions 7 June 27th 06 05:21 PM


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

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

About Us

"It's about Microsoft Excel"