Keystroke Trapping

Jan 18, 2007

Since I practically never deliberately hit Control-2 through Control-5 -- and do hit them "more than never," I thought I'd grab them with the KeyPress event (or KeyDown?). Then it hit me that I'm not sure where it would go.

This is for every workbook so this would generically reside in personal.xls. ThisWorkbook doesn't seem like the right place; I want its scope to be ActiveWorkbook. Would it require a class module (actually, I already looked, and don't see any keyboard events under "App")?

View 9 Replies


ADVERTISEMENT

Only Simply Vba Key Trapping

Mar 23, 2007

I only want to do a "macro" in VBA that must do two things
record the keys pressed (during only 5 minutes)
and save the results in a text file

It is the only code in VBA I try to write

I found public documentation (legal stuff I mean)
about GetKeyState

I have snippets of code for save data as txt file

But I don't succeed in finishing the all code.

My purpose is to show to my daughter in law that if she doesn't respect rules
on the net, I'm able (but I don't want to really do it, it's just a threat) to know what she's doing.

If I want a real keylooger, I've downloaded one on the net.
I haven't done that and I don't want to.

I don't think a vba code with
the function getkeystate and Open file (an only that)
is a danger.

View 3 Replies View Related

Trapping A Msgbox During Validation

Oct 23, 2008

The below code validates values in a combined range. Values can be a 0 or a 3-digit combo of values 0 through 4. The problem is that whenever the Delete key is pressed to delete an acceptable value, the msgbox appears. How can the msgbox appear ONLY if a user tries to enter a wrong value--the cells can be, and are, left null regularly, so the msgbox is annoying.

View 3 Replies View Related

Trapping Userform Events

Jan 9, 2009

I'm trying to trap the events of a user form in a class of mine. At the top of my class I have the standard:

View 2 Replies View Related

Trapping File Version In VBA?

Dec 11, 2012

how I could amend the following code so that my target worksheet includes file versions? The worksheet range "Folder" contains a string specifying the target folder and the worksheet range "IncludeSubFolders" is either TRUE or FALSE. I can trap FilePath, FileName, FileSize and DateModified fine but not File Version (I'm working with DLL libraries).

Code:

Dim iRow As Long
Sub ListFiles()
iRow = Range("DatabaseStart").Offset(1, 0).Row
Call ListMyFiles(Range("Folder"), Range("IncludeSubFolders"))
End Sub

[Code]......

View 1 Replies View Related

Error '9' Trapping Worksheet

May 1, 2007

IS there any code where I can use to error trap worksheet so that if any error occurs like runtime error 9 then it can be traped.

View 2 Replies View Related

Error Trapping When Reading From Another Workbook?

Jun 3, 2014

I'm using VBA to open several files and pull information from them into a workbook with the hopes of eventually outputting the information to a formatted text file that can be uploaded to a data transfer system that will fill out a form for me. The problem I am finding is that the workbook that I need to access has faulty VBA code that executes everytime the workbook is opened. I realize the easiest solution would be to fix the code that is faulty however the workbook that I am accessing is automatically generated for each product with the faulty code embedded requiring me to handle the error on the back end. Attached is my code and I attempted using error trapping to handle this issue but I've concluded that I either lack understanding of error trapping or the fact that the error is in a cascaded workbook complicates the error trapping code.

View 5 Replies View Related

Trapping Outline Expand / Collapse

May 15, 2009

I suspect I need a class module for this...

How do I trap the event when a user chooses to expand / collapse outlines (columns in this instance) on a worksheet?

Basicallly, when attempting to expand I want to prompt the user to enter a password and then unprotect the sheet. And if collapsing to prompt again and then protect the sheet. I have this bit covered, just not sure how to trap the event.

View 9 Replies View Related

Run Macro On Keystroke

Jul 11, 2009

I have the following in WorkBook and would like it executed when I hit enter after entering data into "Quarter":

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Set WatchRange = Range("Quarter")
Set IntersectRange = Intersect(Target, WatchRange)
If Not IntersectRange Is Nothing Then Application.Run "PERSONAL.XLSB!ChangeRangeNames"
End If
Application.EnableEvents = True
End Sub

View 9 Replies View Related

Recalculate List Per Keystroke?

Jan 2, 2013

I have a list of asset numbers that I am displaying to a user. I have a cell where the user is to type in the asset number. What I would like is to be able to display a list of matches in another group of cells.

I.e. - if the cell is populated with "D49", the list on the right will contain all asset numbers starting with "D49"...

I can do this easily enough if I wait for the "Change" event on the worksheet - but this necessitates the user typing some in, hitting enter, etcetera.

Is there any way to trigger an event per keystroke instead of on worksheet.change?

View 4 Replies View Related

Keystroke To Select Data

May 21, 2009

I want (using keystrokes only) to Save As my workbook with the data in a certain cell. However, when I select this cell, and then ctrl + c, it copies the cell (not just the data inside), and so it doesn't let me paste this as the name of the document. Does anyone know how to use keystrokes to highlight the data itself in a selected cell.

View 3 Replies View Related

How To Code A Down Keystroke In Macro

Jun 4, 2009

this it the row. Article No. is A1, but G04532 is A10073 because of sorting. I want to select A1 and do a for loop downwards to see if the next cell is the same. Ultimately i want to copy A1:A7 because they are the same....

View 9 Replies View Related

Excel 2007 :: How To Retrieve Error Trapping Options In VBA

Aug 13, 2014

How can we "read" information from the VBE Error Trapping options (Break on All Errors/ Break in Class Module/ Break in Unhandled Errors) programmatically?

Background: I am developping a spreadsheet that needs to be sent around to distant users. Some of them might not have the default "Break on Unhandled Errors" setting), which would just make my programme fail or risk to fail...

This issue has been covered in the thread below, but the proposed solution doesn't work on my side (always returning the same output!): [URL] .....

Hint: it has been suggested to look into the registry, which the linked post does.

Ideally, I would love to be able to change the setting programatically, but that seem near to impossible in excel 2007 VBA (unless calling an external programme that closes and restarts excel after having changed the option?...)

View 10 Replies View Related

Numbering Rows - Keystroke Shortcut

Jan 27, 2014

I have a file containing data which is about 6000 rows deep by 15 columns

There is a column which has a number in each row which starts at 1 and going down to 100

I want to continue this down to 6000 and I know I can put the little cross at the bottom side and drag it down if I like

Any faster way to do this like a keystroke shortcut.

View 10 Replies View Related

Macro Pause Then Resume By Keystroke

Nov 11, 2012

Is there a way a macro can be paused then resume running the macro by a keystroke, not a time delay.

View 3 Replies View Related

Single-Keystroke Data Entry

Dec 27, 2002

How to set up a sheet with single-keystroke data entry. I am writing a sheet to store golf scores. I need to be able to key in scores at a high rate of speed.

The allowed data are: 1, 2, 3, 4,5 6, 7, 8, 9. I want the operator to be able to press 3 (or Alt-3) and get:a) a 3 is typed into the cell.
b) the cursor moves to the right one cell.
Etc. for 1 thru 9.

View 9 Replies View Related

Select Option Button With Keystroke

Jun 18, 2007

I have a userform with 3 option buttons. Each buttin is set to display another userform.

Private Sub OptionButton1_Click()
Userform1.Show
End Sub
Private Sub OptionButton2_Click()
Userform2.show
End Sub
Private Sub OptionButton3_Click()
Userform3.Show
End Sub
Private Sub UserForm_Click()

End Sub

Right now the form is running perfectly. If I select an option with the mouse the correct form shows right up. The issue I have is that, the excel file will be running on a computer that will have no mouse. It will be using a barcode reader as its primary input source. What i would like to do is have the user swipe a 1,2 or 3 will the barcode reader or keypad.

View 9 Replies View Related

Making Spacebar Follow A Keystroke Pattern????? Add-in???

Dec 7, 2006

I am using a bar code gun to enter numbers. There are two bar codes on each item that I am scanning requiring two columns for each item. Right now I squeeze the trigger and the number pops up into the currently active cell. Then I use the arrow key to move over one cell and squeeze the trigger for the next number. Then Down arrow following with a left arrow to move the highlighted cell down one line back to the first column. Kind of inefficient because although repetitive there is room for errors on my part.

Is there a way to make it that every time I press the space bar or some other key that excel highlights a cell following my desired pattern? At least for the time that I am using the bar code gun? Making it so pressing the space bar would advance the selected cell over, then down and left, then over, then down and left, alternating with each press following that pattern ad infinitum. I have to scan hundreds of these babies.

Would this be difficult? I’m not the programming type. Any help would be greatly appreciated. At least I no longer have to manually type each number in. That was a real bummer.

View 9 Replies View Related

Intercept & Cancel Keystroke Events When CommandButton Is Active

Jan 11, 2010

I'm building an Excel worksheet into a kind of dashboard with CommandButtons and TextBoxes to drive the functionality of the rest of the document.

I'm trying to recreate some of the functionality of a UserForm (e.g., tab order). I'm using the CommandButton's KeyDown event to respond if the user presses Enter:

View 14 Replies View Related

Excel 2010 :: Keystroke To Select Variable Name From Dropdown List?

Jan 23, 2013

I've defined a number of variables in my spreadsheet. When I want to use one I type "=variablename" and 'm presented with a list menu.jpg

In the above example, I have several variables starting with the word "Harvard" (a town, not the university :-)

How do I select one of these without having to double click with the mouse.

Up and down arrows allow me to highlight an item but I cannot find a keystroke that allows me to select the highlighted item. Instead I have to lift my hand off the keyboard and use the mouse.

Excel 2010

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved