Beep From KeyPress

Sep 13, 2009

I've got a small - almost "cosmetic" problem. I have a listBox on a userForm and I'm checking for a keystroke combination to see if the user wants to edit related data. That's working fine. However, when I return to the userForm, it beeps at me. Impertinent! I think it's because Excel doesn't know what to do with the keyStroke that I used - Alt U. I've attached code. I think that I just have to set the keycode to something that will be ignored by Excel.

View 2 Replies


ADVERTISEMENT

Beep & Flash

Feb 27, 2007

I am trying to have a number if >10 "Flash" and "Beep".

I can not get it to both.

The first code is in a "Module" and the second code is in the "Sheet Code".

Option Explicit

Sub Wait(tSecs As Single)
' Timer to create a pause
Dim sngSec As Single

sngSec = Timer + tSecs
Do While Timer < sngSec
DoEvents
Loop
End Sub

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As Integer
If Target.Address "$A$1" Then Exit Sub
If Target.Value > 10 Then
For x = 1 To 5

View 9 Replies View Related

Beep Sound When Condition Met?

Feb 26, 2014

The macro below is adding the SUM cell. Is it possible to make a beep sound when SUM cell value will be the same as one on the left?

[Code] .....

View 8 Replies View Related

Beep Sound Will Not Play

Jun 25, 2009

I am trying to make a sound play in excel. I have the following code in an excel spreadsheet on my computer at home. When I do the same code on my computer at work, the sound will not play.

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("joe").Value > 100 Then
For x = 1 To 3
Beep
Next x
End If
End Sub

Any thoughts as to what the problem is?

View 7 Replies View Related

Limit KeyPress To Text Only

May 26, 2009

Iv found some code that will limit my textbox entry to numbers only, i dont quite understand how it works and i need to change it so it limits the textbox keypress entry to Text Values only.

View 3 Replies View Related

Event Keypress, Tab Or Keydown And Setfocus

Aug 26, 2009

How to setfocus on a cell, when user press enter, key up, or tab ?
examp. :

i want setfocus to cell A5, when i press enter or key up on cell A2.

View 2 Replies View Related

Writing Function For Textbox Keypress Event

Oct 1, 2009

I have got some code that is duplacated a few times. It allows only number values to be entered into a textbox.

Is there a way to make a function out of this to cut out the duplication of code.

View 7 Replies View Related

Creating Macro Dynamically On Keypress And Execute

Apr 1, 2014

creating macro dynamiccally on keypress and execute it

i have 3 excel sheet sheet1, sheet2, MasterSheet

MasterSheet conatins the following

COLUMN A COLUMN B COLUMN C

Colorcode FLAG SKEYS

RGB(121,223,214) A Ctrl+a

RGB(125,228,114) B Ctrl+b

[code]....

I have 3 columns column 1 contains colorcode in RGB format column 2 Contains FLAG and column 3 contains SHORTCUT KEYS

i have a macro in sheet1 & sheet2 for coloring the backgrouf color of the selected rows in sheet1 or sheet2

Code:
Sub Macro_color()
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = RGB(234, 241, 221)
.PatternTintAndShade = 0
End With

what i need is when th user presses say Ctrl+c , RGB(233,129,220) from the MasterSheet needs to be copied in the macro as .Color = RGB(233,129,220) instead of RGB(234, 241, 221) and the selected row in sheet1 shld be colored. how can it be done

View 1 Replies View Related

Get 2 Textboxes To Display Different Strings Based On Keypress

Mar 19, 2008

I have a Userform whose purpose it is to capture payment information, in particular Creditcard information. To this end it has (amongst other elements) 2 textboxes - textboxCardNr1 and TextboxCardnr2.

the User enters the cardnr in Textboxcardnr1 as, e.g. 4321098765432109. Through the code below I transform this into the more readable number
4321-0987-6543-2109. I capture the keypress instance to only allow numbers to be entered in this field and to simultaniously update TextboxCardNr2 with the keystrokes.

On exiting TextboxCardNr1 the content of TextboxCardNr2 is copied to the clipboard to be available for pasting on a secure website in the approriate field.

My problem is, that when the user makes a mistake and changes the number in TextboxCardNr1, those changes are not automatically mirrored in TextboxCardNr2.

I want the easy to read form of the card - with the dashes, to be saved. The website the user is pasting the content of TextboxCardnr2 to does not accept the number with dashes.

Private Sub TextBoxCardNr1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Dim taste As String
Dim wert As String

taste = VBA.Chr(KeyAscii)
wert = Me.TextBoxCardNr1.Text

KeyAscii = 0
If taste = "0" Or taste = "1" Or taste = "2" Or taste = "3" Or taste = "4" Or taste = "5" Or taste = "6" Or taste = "7" Or taste = "8" Or taste = "9" Then If Not Me.TextBoxCardNr2.Text Like "################" Then
Me.TextBoxCardNr2.Text = Me.TextBoxCardNr2.Text & taste............................

View 9 Replies View Related

Trigger A Sound Within Excel/VB Other Then Using The "BEEP" Command?

Jun 28, 2006

Is there any way to trigger a sound within Excel/VB other then using the "BEEP" command?

Can the Windows Sounds be accessed?

View 6 Replies View Related

Inscribing Cells: Run A Macro On Enter Keypress, That Would Execute Different Code Depending On That "inscription" That Would Be Invisible To User

Feb 20, 2007

Is there any way to "Inscribe" a cell? I would like to run a macro on Enter keypress, that would execute different code depending on that "inscription" that would be invisible to user. I could use some properties of . Validation property like this:

Private Sub EnterPressed
'following code to ensure proper functioning of Enter in any other Worksheet
If ActiveSheet <> mySheet 'MySheet is global Variable then
ActiveCell.Offset(1,0).Select
exit Sub
End If
'now the real code
If ActiveCell.Validation.InputMessage = "1" Then
ActiveCell.Offset(0,1).Select
Else
'something else
End If
End Sub

The problem is, I use Data Validation and Conditional Formatting, so can't use any of these properties.

View 8 Replies View Related







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