ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Positioning Worksheet names on Activate (https://www.excelbanter.com/excel-programming/363100-positioning-worksheet-names-activate.html)

JimMay

Positioning Worksheet names on Activate
 
The below code allows me to switch
Worksheets with ease (tks to Tom Ogilvy); One last thing I'd like to be
able to do (with my 100 sheets) is have the selected sheet Appear in
position one (scrolled to the First position in the view). Meaning if
Before reselecting from my cb my w/s's shown (below) might be A20, A21,
A22, A23, A24.... (then from The Combobox) I select sheet A60 - as a
result A01 thru A59 are placed out-of-sight to the left and I see in the
first position A60, A61, A62, A64.....
Can this be done?
If so, with what code?
TIA,




Private Sub ComboBox1_Change()
Myws = ComboBox1.Value
Worksheets(Myws).Activate
AppActivate Application.Caption
End Sub


Norman Jones

Positioning Worksheet names on Activate
 
Hi Jim,

Try:

'=============
Private Sub ComboBox1_Change()
Dim MyWs As String

MyWs = ComboBox1.Value
With Worksheets(MyWs)
.Move Befo=Sheets(1)
.Activate
End With
AppActivate Application.Caption

End Sub
'<<=============

---
Regards,
Norman


"JimMay" wrote in message
news:SzVfg.34326$fG3.6742@dukeread09...
The below code allows me to switch
Worksheets with ease (tks to Tom Ogilvy); One last thing I'd like to be
able to do (with my 100 sheets) is have the selected sheet Appear in
position one (scrolled to the First position in the view). Meaning if
Before reselecting from my cb my w/s's shown (below) might be A20, A21,
A22, A23, A24.... (then from The Combobox) I select sheet A60 - as a
result A01 thru A59 are placed out-of-sight to the left and I see in the
first position A60, A61, A62, A64.....
Can this be done?
If so, with what code?
TIA,




Private Sub ComboBox1_Change()
Myws = ComboBox1.Value
Worksheets(Myws).Activate
AppActivate Application.Caption
End Sub




tony h[_124_]

Positioning Worksheet names on Activate
 

The window.scrollworksheettabs should do it

regards


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=547805


Norman Jones

Positioning Worksheet names on Activate
 
Hi Jim,

Please ignore my response as I misinterpreted your question.


---
Regards,
Norman



JimMay

Positioning Worksheet names on Activate
 
Fantastic!!
Tks Norman,
Jim

"Norman Jones" wrote in message
:

Hi Jim,

Try:

'=============
Private Sub ComboBox1_Change()
Dim MyWs As String

MyWs = ComboBox1.Value
With Worksheets(MyWs)
.Move Befo=Sheets(1)
.Activate
End With
AppActivate Application.Caption

End Sub
'<<=============

---
Regards,
Norman


"JimMay" wrote in message
news:SzVfg.34326$fG3.6742@dukeread09...

The below code allows me to switch
Worksheets with ease (tks to Tom Ogilvy); One last thing I'd like to be
able to do (with my 100 sheets) is have the selected sheet Appear in
position one (scrolled to the First position in the view). Meaning if
Before reselecting from my cb my w/s's shown (below) might be A20, A21,
A22, A23, A24.... (then from The Combobox) I select sheet A60 - as a
result A01 thru A59 are placed out-of-sight to the left and I see in the
first position A60, A61, A62, A64.....
Can this be done?
If so, with what code?
TIA,




Private Sub ComboBox1_Change()
Myws = ComboBox1.Value
Worksheets(Myws).Activate
AppActivate Application.Caption
End Sub



Norman Jones

Positioning Worksheet names on Activate
 
Hi Jim,

Fantastic!!
Tks Norman,


Then, perhaps I was overly pessimistic in my assumption that I had
misinterpreted your requirements!


---
Regards,
Norman




All times are GMT +1. The time now is 05:08 AM.

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