Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Tab control from control to cell

Lets get this out of the way...I am using the following for tabbing
between controls in my Excel sheet.
--------------------------------------------------------
Private Sub ComboBox103_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
Dim bBackwards As Boolean
Const ctlPrev As String = "ComboBox102"
Const ctlNext As String = "ComboBox104"

Select Case KeyCode
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp
Application.ScreenUpdating = False
bBackwards = CBool(Shift And 1) Or (KeyCode = vbKeyUp)
If Application.Version < 9 Then Sheet1.Range("A1").Select
If bBackwards Then
Range(ctlPrev).Activate
Else
ActiveSheet.OLEObjects(ctlNext).Activate
End If
Application.ScreenUpdating = True
End Select
End Sub
-------------------------------------------------------
This is fine but what If I want the next Item to be a cell in the
document, lets say E22. How can I have it tab to that cell and then
get E22 to tab away to the next thing I want a tab in?

If that makes any sense I would appreciate the help.

Thanks as Always,
Jason Self


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Tab control from control to cell

Jason ,

Just put the cell address in ctlPrev

Const ctlPrev As String = "E2"

Out of the way!

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"JasonSelf " wrote in message
...
Lets get this out of the way...I am using the following for tabbing
between controls in my Excel sheet.
--------------------------------------------------------
Private Sub ComboBox103_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
Dim bBackwards As Boolean
Const ctlPrev As String = "ComboBox102"
Const ctlNext As String = "ComboBox104"

Select Case KeyCode
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp
Application.ScreenUpdating = False
bBackwards = CBool(Shift And 1) Or (KeyCode = vbKeyUp)
If Application.Version < 9 Then Sheet1.Range("A1").Select
If bBackwards Then
Range(ctlPrev).Activate
Else
ActiveSheet.OLEObjects(ctlNext).Activate
End If
Application.ScreenUpdating = True
End Select
End Sub
-------------------------------------------------------
This is fine but what If I want the next Item to be a cell in the
document, lets say E22. How can I have it tab to that cell and then
get E22 to tab away to the next thing I want a tab in?

If that makes any sense I would appreciate the help.

Thanks as Always,
Jason Self


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Tab control from control to cell

I actually figured out just that not to long before you replied. I d
have the question though of once I have tabbed into that cell how I ca
convince VBA to let me tab out. In the event of a control object
would simply name the object.

Private Sub ComboBox102_KeyDown

how would I name this if it were refering to a specific cell like ou
E

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Tab control from control to cell

I think you are out of luck. Shapes have a KeyDown event, but cells don 't .
Normal tabbing takes over from then on.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"JasonSelf " wrote in message
...
I actually figured out just that not to long before you replied. I do
have the question though of once I have tabbed into that cell how I can
convince VBA to let me tab out. In the event of a control object I
would simply name the object.

Private Sub ComboBox102_KeyDown

how would I name this if it were refering to a specific cell like our
E2


---
Message posted from http://www.ExcelForum.com/



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
Process control chart for quality control in exel? Kara Charts and Charting in Excel 2 May 11th 10 05:45 PM
2007 Form Control/ActiveX Control font difference Nikko963 Excel Discussion (Misc queries) 0 April 15th 09 04:21 PM
Excel spin box - no Control tab in Format Control dialong box tocoau Excel Worksheet Functions 7 August 10th 08 03:15 PM
Difference between a Forms Control verus Active-X Control funGT350 Excel Discussion (Misc queries) 6 May 6th 08 11:20 PM
Shift-Control Arrow and RefEdit Control? Ariel[_2_] Excel Programming 12 January 6th 04 11:10 PM


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