using the mouse to do numeric input

E

Evans

Does anyone have any experience in using mouse clicks in a cell to index
numbers, or any experience with voice recognition systems to do this?

We use excel to input numbers from a voice mail system into a form. I would
like to point to a cell and click it to enter the number one a second click
would enter 2 and so on. Or better yet use a headset and microphone to do
all of the entry.
 
D

Don Guillett

Right click sheet tab>view code>copy/paste this.
If you doubleclick cell a5 or a6 the number will increase by 1 for each
double click
You could use a worksheet_selectionchange but it could be dangerous if you
inadvertently selected.

Private Sub Worksheet_BeforeDoubleClick(ByVal target As Range, Cancel As
Boolean)
If target.Address = "$A$5" Or target.Address = "$A$6" Then
On Error GoTo fixit
Application.EnableEvents = False
If target.Value = 0 Then oldvalue = 0
target.Value = 1 * target.Value + 1
oldvalue = target.Value
fixit:
Application.EnableEvents = True
End If
Cancel = True
End Sub
 
E

Earl Kiosterud

Evans,

Take a look at the On-Screen Keyboard in Accessibility Options (Start - Programs -
Accessories - Accessibility).

--
Earl Kiosterud
www.smokeylake.com

Note: Some folks prefer bottom-posting.7
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
 
C

CLR

Here's one that might do what you want..........

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim Cellval
If Range("a1").Value = "" Then
GoTo 100
Else
If Range("a1").Value = "+" And Target.Address = "$A$2" Then
Cellval = ActiveCell.Value
Cellval = ActiveCell.Value + 1
ActiveCell.Value = Cellval
Else
If Range("a1").Value = "-" And Target.Address = "$A$2" Then
Cellval = ActiveCell.Value
Cellval = ActiveCell.Value - 1
ActiveCell.Value = Cellval
Else
End If
End If
End If
100
End Sub

Vaya con Dios,
Chuck, CABGx3
 
C

CLR

How cool that is, Earl.....thanks for the info........I actually typed this
response with it.....it works well!

Vaya con Dios,
Chuck, CABGx3
 
E

Earl Kiosterud

Chuck,

Yeah. It reminds me of when I was fooling around with SendKeys to put worksheet stuff into
an application (didn't seem to be any other way). I actually had an experimental VBA
routine that filled out an entire email in OE, including the address box and subject line
and sending it. What we don't do for cool stuff!
--
Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
 
E

Evans

Unbelievable.....exactly what I wanted to do. I am not an expert at coding.
Can this be modified to do ranges of cells?

Again thanks.
 
E

Evans

Each sheet is different howeve it could be columns or something like A1 thru
A10 and then C1 thru C10.
Most of the sheets only have 2 columns that are populated.

Again thanks for your help.
 
D

Don Guillett

chg this
If target.Address = "$A$5" Or target.Address = "$A$6" Then
to this
If Not Intersect(target, Range("a1:a10,c1:c10")) Is Nothing Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top