Resume Keys Normal Function After OnKey
Sep 1, 2006
I use the following code to assign a macro to right arrow key.
Application.OnKey "{RIGHT}", "myMACRO"
My questin is how to let the right arrow key resume its normal function, that is move from left to right (A2 to A1) if I do not want the macro any more and without quit and restart EXCEL? The following code disabes the right arrow key's normal function. Application.OnKey "{RIGHT}", ""
View 2 Replies
ADVERTISEMENT
Sep 3, 2008
Does anyone know of any way at all to trap a function key while a userform is being shown, or will I need API for that?
View 13 Replies
View Related
Mar 13, 2007
This is still the continuing saga of the Toastmasters countdown speech timer. I got past the timer loop issue but now I need a way to detect (preferrably) the spacebar being pressed during the timer loop. I want that keypress (or any other key if spacebar isn't do-able) to end the timer loop and run the WriteLog routine.
I am coming to the conclusion that Onkey is not what I want.
View 9 Replies
View Related
Apr 10, 2009
Have working routine with combobox lists which are split into 'beverages of sorts' - sent to textbox and from there put into columns of type/variety in other worksheets
All working fine apart from repeated 'hits' of the command buttons to activate the data movement
Have Excel2003 on XP Pro and have been trying to use the application.onkey sub to try and introduce the 'enter' key to try and make things easier
but......not winning (aaaagh)
code being used just now is
Sub commandbutton1_click()
Sheets("invsales").Activate
Worksheets("invsales").Range("value").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = TextBox6.Value
End sub
As you see from 'textbox6' - I have a few of these for different beverage types and costs
Would be grateful for any help in introducing an 'ENTER' keystroke into the code somewhere.....to make it that bit more 'easier'
View 9 Replies
View Related
Sep 19, 2006
I need to assign a procedure to the OnKey method, but VBA does not let me specify arguments with it.
View 4 Replies
View Related
Oct 20, 2006
Onkey is used to make something when a key is pressed. There is a instruction to make something when any key is pressed?
View 4 Replies
View Related
Jan 20, 2010
Why doesn't this code exit on the first "Cancel" selection from the first inputbox?
When I select Cancel from the first inputbox it goes to the next inputbox and I have to select Cancel again, then it exits the sub.
View 4 Replies
View Related
Apr 10, 2008
Cells.Find(What:="flags", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
'if there is an error, ignore it and continue
On Error Resume Next
Selection.EntireColumn.SpecialCells(xlCellTypeConstants, 1).EntireRow.Delete Shift:=xlUp
'reset normal error handling
On Error GoTo 0
I am finding the cell marked "flags", then in that column look for the special cell and delete the rows where they are found. It works when it actually finds those cells, but it reports an error when no cells were found.
View 9 Replies
View Related
Jun 2, 2006
Is there a way to resume running a code should there be an incompatible file that causes an error? Currently I'm reading a bunch of excel sheets, but there might be some sheets that aren't formated as such and cause an error 400.
View 5 Replies
View Related
May 15, 2008
Using the code I got from the Forum Drop Down I added the subs to put a custom command button in the right menu. The first thing it does is delete any existence of the menu item so that you don't get a new one every time you right click your menu. I has just a clear as day "On Error Resume Next". But when it encounters the delete command the error dialog pops up and says "Run time error 5. Invalid procedure call or argument."
View 4 Replies
View Related
Aug 3, 2009
I'm trying to have a macro move down one cell and resume from the start if it finds nothing.
View 14 Replies
View Related
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
Jul 27, 2007
I have a workbook with several hundred row the VBA code loops through. It takes about an hour to run all the calculations. Whenever I need to pause the script I hit ESC, which works well for me, but for other users it would be nice to have a command button that halts code. Even better would be another button to resume code.
View 9 Replies
View Related
Apr 24, 2008
I've got some code (at bottom) which works very well for small groups of data but when it gets large it hangs excel. Had heard that I can make code which will get it to pick up on the row after where it left off rather than having it run the entire loop again. Specifically speaking of the raw data sheet. It is sorted by date and by code so that if it works on the first code for the date it won't have to return to that row again for data. Uncertain how to implement that approach. (sample data layout below)
Option Explicit
Sub DoubleDirectionLoop()
Dim Wb As Excel.Workbook
Dim Ws1 As Excel.Worksheet, Ws2 As Excel.Worksheet
Dim iCol As Integer
Dim iRow As Integer, iRow2 As Integer
Dim Loop1 As Integer, Loop2 As Integer
Dim Loop3 As Integer, PeakSum As Long
View 9 Replies
View Related
Oct 23, 2008
Before doing some modifications in a data sheet, I first check with the below code whether a certain list is complete or not using the VLOOKUP function. If I encounter a missing value in the list, a userform appears asking to fill out 3 data fields, which are then added to the original list to complete it. All of this works fine if only one line is missing; if there are two (or more) lines missing, all goes well untill the VLOOKUP function errors out on the second line missing.
I can't find out why everythign goes welll with the first missing line, but not with the second missing line.
Sub proCheckVesselCodes()
Sheets("Sheet4").Select
Range("K1").Value = "Check"
Set varRange1 = Range("A1")
fctCountNrRows
varRow1 = varRow
varRow2 = 2
jump:
On Error Goto addvessel...............
View 3 Replies
View Related
Feb 1, 2007
The following code shows the bare bones which illustrate my problem. The routine runs whenever the user enters a string which begins "Frm1=" and contains exactly three commas.
My problem is with the MsgBox which appears if the ErrorHandler is reached. With the following code the MsgBox requires two clicks on OK to dismiss it. If I change Resume to GoTo it requires only one. Is this normal? Is there any way of dismising the MsgBox with one click? ...
View 9 Replies
View Related
Aug 10, 2012
I have some code below. I have error handling in place for when it tries to open a specific file. If it isn't there then user has option to continue and ignore this file, or browse and select a new one.
The problem is, when the user wants to ignore the file, the "Resume Next" continues to run the VBA assuming the file was ok i.e. the code after the line to open the file. What I would like is for it to skip the succeeding code and go to look for the next file.
Below is the VBA:
Code:
For i = 0 To 2 Step 1
'add in error handling for if the file is missing
On Error GoTo MissingFile
Workbooks.Open Filename:="\hbeu.adroot.hsbcdfsrootgb002hfcfinance01fnce" & qfolder & "Data" & qfile(i), UpdateLinks:=False, ReadOnly:=True
[Code] .........
Missing File:
qMissingPrompt = "There was an error opening data file. Click OK to browse or Cancel to ignore and move to next file"
qAns = MsgBox(qMissingPrompt, vbOKCancel)
'click cancel - ignore error and move onto the next file
If qAns = vbCancel Then
[Code] .......
So, where it says Resume Next, currently it will start running the following (after On Error Goto 0)
Code:
Set datawb = ActiveWorkbook
range("A2").Select
Do Until ActiveCell.Value = ""
etc.
What I would like it to do is go back to is to go to the next i
Code:
For i = 0 To 2 Step 1
Or even to go to the 'Next' statement at the end so that it moves onto the Next i and tries to open the next file.
View 2 Replies
View Related
Oct 24, 2005
I know EXCEL has functions for both the NORMAL DISTRIBUTION and the
cumulative value thereof...
but is it possible to graph this data..
(I imagine if I sort the data and then calculate the ***. distributions into
a column...then chart it, it should work; BUT IS THERE ANOTHER WAY?)
View 13 Replies
View Related
Apr 28, 2013
I keep reading that this "Application.Dialogs(xlDialogPrint).Show" brings up the same dialog as File-> Print or Cntrl+P but it does not.
Instead I get this wrong.jpg
When I actually need this correct.jpg
How to get the second one?
View 7 Replies
View Related
Nov 16, 2006
Say I measure the height of 1000 people and I have those in a column in excel. It should be a normal distribution with mean x and standard deviation y. How do I actually graph it so I can see the normal distrubution curve that looks something like this:
[url]
I tried making a scatter graph but it graphs them point by point. I want the height to be on the x axis and something like frequency on the y axis.
View 5 Replies
View Related
May 30, 2007
I have a value say £11.50 what i need is for this to be turn in to 1150 no point.
When i try on excel i get it to 115
View 4 Replies
View Related
Jul 18, 2007
i have some number that i want to put in a normal distribution
so.. i have age ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) and have the number of times that the kid wake in the night ( 10, 12, 9,11,8,9,7,9,11) and want to do the normal distribution grafic with that .
View 3 Replies
View Related
Feb 22, 2014
How to crate a chart for normal distribution for a set of datas. say marks of students/ number of students in a class
View 1 Replies
View Related
May 11, 2014
I'm trying to make a bell curve (normal gauss distribution). I have some problems regarding the probability density curve, since its values are so low. If you look column N in the attached file - I used the NORMDIST command. Values should be somewhere between 0,2 and 0,4 - but they're about 100x lower.
View 2 Replies
View Related
Mar 16, 2013
I sometimes come across spreadsheets that have only a few white, "normal" looking cells and the rest are grey with no borders.
Usually there is a thick blue line around the "normal" cells and I can make more cells look "normal" by dragging the blue border line.
What is this? And, how do I set it up in a spreadsheet if I need to?
View 2 Replies
View Related
Oct 31, 2009
I am currently using Excel 2007 and I am trying to find a good working formula for Normal Hours worked:
I have the following code for Total Hours, Time and a Half and Double Time hours but I can't seem to get the right formula for working up to 8 hours.
Whereas C11 = Total hours added for the day.
=MOD(SUMPRODUCT(C8:C10-C7:C9),1) =Total Hours Worked
=Normal work hours between 0 to 8 hour work day.
=MIN("04:00",MAX(0,C11-"08:00")) =Time and a Half hours over 8 hours worked.
=MAX(0,C11-"12:00") =Double Time hours over 12 hours worked
View 9 Replies
View Related
Jul 19, 2006
in VBA the RND function generates a random number using uniform distribution (every number is as likely as any other). Is there a function to generate a random number using normal distribution where the numbers closest to the mean are more likely to occure then numbers further away from the mean. I've created the following custom function to generate a random number between two given values using uniform distribution.
Function RandNum(Min As Double, Max As Double) As Double
RandNum = (Max - Min) * Rnd + Min
End Function
View 6 Replies
View Related
Nov 27, 2007
I would like to create a random number based on that data.
View 3 Replies
View Related
Jan 12, 2014
What I mean by my "bold" underlines:
QRG5UUl.png
Notice the difference between the bold underline and the normal ones. There is also some weird thing happening where in some cells, when I use the underline feature, it shows as a bold underline, but once I've pressed enter to move on to another cell, the underline reverts back to normal. If I select to edit (F2 or double-clicking) said cell, the underline becomes bold, and vice versa (s3lw.png).
All this started happening immediately after I did this (was just experimenting, and I have no idea what this actually does, or if it was the cause of those occurences): Insert > Symbol > Special Characters > No-width optional break. I did that to just one cell though, and now all this weird stuff is happening.
View 4 Replies
View Related
Aug 28, 2002
I would like to create a histogram from experimental data with the normal distribution curve overlaying the histogram.
View 7 Replies
View Related