Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Are there any difference between the two following lines of VBA code? Sheet1.Activate Sheet1.Select In other words, are there any times they will mean something different within the VBA code? Thanks, mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=474813 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mike
If you have more sheets selected Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select Sheets("Sheet2").Activate It will activate Sheet2 ( all other sheets are still selected) Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select Sheets("Sheet2").Select If you use select, Sheet2 is the only sheet that is selected then -- Regards Ron de Bruin http://www.rondebruin.nl "mikeburg" wrote in message ... Are there any difference between the two following lines of VBA code? Sheet1.Activate Sheet1.Select In other words, are there any times they will mean something different within the VBA code? Thanks, mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=474813 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets("Sheet2").Activate It will activate Sheet2 ( all other sheets are still selected) Just one little refinement, Ron. The above is true only if there are more than 3 sheets (in your example) in the workbook. With 3 sheets Activate is the same a Select I believe. -- Jim "Ron de Bruin" wrote in message ... | Hi Mike | | If you have more sheets selected | | Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select | Sheets("Sheet2").Activate | | It will activate Sheet2 ( all other sheets are still selected) | | | Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select | Sheets("Sheet2").Select | | If you use select, Sheet2 is the only sheet that is selected then | | -- | Regards Ron de Bruin | http://www.rondebruin.nl | | | "mikeburg" wrote in message | ... | | Are there any difference between the two following lines of VBA code? | | Sheet1.Activate | Sheet1.Select | | In other words, are there any times they will mean something different | within the VBA code? | | Thanks, mikeburg | | | -- | mikeburg | ------------------------------------------------------------------------ | mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 | View this thread: http://www.excelforum.com/showthread...hreadid=474813 | | | |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are correct Jim
Thanks -- Regards Ron de Bruin http://www.rondebruin.nl "Jim Rech" wrote in message ... Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select Sheets("Sheet2").Activate It will activate Sheet2 ( all other sheets are still selected) Just one little refinement, Ron. The above is true only if there are more than 3 sheets (in your example) in the workbook. With 3 sheets Activate is the same a Select I believe. -- Jim "Ron de Bruin" wrote in message ... | Hi Mike | | If you have more sheets selected | | Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select | Sheets("Sheet2").Activate | | It will activate Sheet2 ( all other sheets are still selected) | | | Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select | Sheets("Sheet2").Select | | If you use select, Sheet2 is the only sheet that is selected then | | -- | Regards Ron de Bruin | http://www.rondebruin.nl | | | "mikeburg" wrote in message | ... | | Are there any difference between the two following lines of VBA code? | | Sheet1.Activate | Sheet1.Select | | In other words, are there any times they will mean something different | within the VBA code? | | Thanks, mikeburg | | | -- | mikeburg | ------------------------------------------------------------------------ | mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 | View this thread: http://www.excelforum.com/showthread...hreadid=474813 | | | |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks a bunch. I am trying to learn. mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=474813 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
=[Book.xls]Sheet1!A1 and not c:\blah\=[Book.xls]Sheet1!A1 | Excel Discussion (Misc queries) | |||
[=Sheet1!A1] - if i use Column A1 ('Sheet1') / A2 ('Sheet2') | Excel Worksheet Functions | |||
Sheet1$A1:A1 vs Sheet1$ | Excel Programming | |||
Why Sheet1 is displayed in modules as sheet1 | Excel Programming | |||
Sheet1 object not Worksheets("Sheet1") | Excel Programming |