ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   SetFocus on a different sheet in VBA (https://www.excelbanter.com/excel-discussion-misc-queries/30051-setfocus-different-sheet-vba.html)

AaronC

SetFocus on a different sheet in VBA
 

In my workbook, I have 2 worksheets. Sheet2 contains the raw data.
Sheet1 is a summary level of the raw data containing many calculations,
formatting, etc.

I have VBA code that populates sheet2 with data from an external source
on the Workbook_Open event.

The last thing I want to do after populating the sheet is to set focus
(or activate?) a different worksheet, in this case, sheet1.

Can anyone tell me how to accompish this? I have searched Help till I'm
blue in the face and can't think any more possible keywords.

Any help is appreciated! Thanks!


--
AaronC
------------------------------------------------------------------------
AaronC's Profile: http://www.excelforum.com/member.php...o&userid=21240
View this thread: http://www.excelforum.com/showthread...hreadid=377903


JE McGimpsey

One way:

Private Sub Workbook_Open()
'Load Sheet2
Me.Sheets("Sheet1").Activate
End Sub

In article ,
AaronC wrote:


In my workbook, I have 2 worksheets. Sheet2 contains the raw data.
Sheet1 is a summary level of the raw data containing many calculations,
formatting, etc.

I have VBA code that populates sheet2 with data from an external source
on the Workbook_Open event.

The last thing I want to do after populating the sheet is to set focus
(or activate?) a different worksheet, in this case, sheet1.

Can anyone tell me how to accompish this? I have searched Help till I'm
blue in the face and can't think any more possible keywords.



All times are GMT +1. The time now is 07:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com