?
Solved

Listobjects: How to show a userform when user clicks on Tab

Posted on 2012-08-20
5
Medium Priority
?
377 Views
Last Modified: 2012-08-29
Hello

I have a listobject called "Orders". As all my entries to the datatable are added by userforms, I want to prevent the user from manually adding data at the end of the table by pressing TAB. I'd like to display a userform called frmOrders instead.

What code should I write?

Thanks for your help

Massimo
0
Comment
Question by:Massimo Scola
  • 3
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
Elton Pascua earned 1000 total points
ID: 38311552
You can substitute myMacro with the actual sub procedure name.

Private Sub Workbook_Open()
    Application.OnKey "{Tab}", "myMacro"
End Sub

Open in new window

0
 

Author Comment

by:Massimo Scola
ID: 38311646
Thanks for your code techfanatic
This code does not work as I've got several worksheets in my workbook.
I tried adding this code to the Worksheet_Activate event but I get an error ..
0
 
LVL 8

Expert Comment

by:Elton Pascua
ID: 38311653
That code can be called once. Did you want to control "tabbing" on a specific range?
0
 

Author Comment

by:Massimo Scola
ID: 38311695
yes, the range is called "Orders"
and I'd use the same "tabbing" on another range called "Customers" with another userform/macro
0
 

Author Closing Comment

by:Massimo Scola
ID: 38345926
thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question