Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro on cell click??

I am a school teacher and use my interactive whiteboard a lot, which is away
from my keyboard. I have a spreadsheet which I log behavioural issues in with
a x, xx, 15 depending on severity of warning.

I have this in the background and open it when i need to input my warnings.
This involves me going to my desk and keying it in.

Is there a way to click on a cell with the mouse, change it to a x, then if
I click a second time to change it to a xx, and then on 3rd click to 15.

I can do it using buttons, but is there any way to do it using a clicking
sequence ona cell only??? Thanks!!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Macro on cell click??

Hi... Thanks very much...

I went into Excel, right clicked the tab, went to view code, and then pasted
the text you gave me into Sheet 1s code (General) (Declarations).

The top line went red "Private Sub Worksheet_BeforeDoubleClick(ByVal Target
As Range, Cancel As
Boolean)".


I then tried to double click a cell... but it just went into enter text mode.

Any ideas?

Thanks.



"Jim Thomlinson" wrote:

There is no on click event in Excel (there is for embeded buttons but not for
cells). There is selection change, but that will not fire if you click the
same cell twice in a row. How about double click? Place this code directly
into the sheet (right click the approporiate tab and select view code. Paste
the following

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Select Case Target.Value
Case Empty
Target.Value = "x"
Case "x"
Target.Value = "xx"
Case "xx"
Target.Value = 15
End Select

End Sub
--
HTH...

Jim Thomlinson


"PG Oriel" wrote:

I am a school teacher and use my interactive whiteboard a lot, which is away
from my keyboard. I have a spreadsheet which I log behavioural issues in with
a x, xx, 15 depending on severity of warning.

I have this in the background and open it when i need to input my warnings.
This involves me going to my desk and keying it in.

Is there a way to click on a cell with the mouse, change it to a x, then if
I click a second time to change it to a xx, and then on 3rd click to 15.

I can do it using buttons, but is there any way to do it using a clicking
sequence ona cell only??? Thanks!!!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Macro on cell click??

Hi... all ok now.

Made it so the top bit wasn't red and it all works brilliantly.

Thanks!!

"Jim Thomlinson" wrote:

There is no on click event in Excel (there is for embeded buttons but not for
cells). There is selection change, but that will not fire if you click the
same cell twice in a row. How about double click? Place this code directly
into the sheet (right click the approporiate tab and select view code. Paste
the following

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Select Case Target.Value
Case Empty
Target.Value = "x"
Case "x"
Target.Value = "xx"
Case "xx"
Target.Value = 15
End Select

End Sub
--
HTH...

Jim Thomlinson


"PG Oriel" wrote:

I am a school teacher and use my interactive whiteboard a lot, which is away
from my keyboard. I have a spreadsheet which I log behavioural issues in with
a x, xx, 15 depending on severity of warning.

I have this in the background and open it when i need to input my warnings.
This involves me going to my desk and keying it in.

Is there a way to click on a cell with the mouse, change it to a x, then if
I click a second time to change it to a xx, and then on 3rd click to 15.

I can do it using buttons, but is there any way to do it using a clicking
sequence ona cell only??? Thanks!!!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Two double click events???

Hello again...

Now I have that in the code, is there a way to, again, use a double click to
turn blank cells into the day's date. I just want this to work for the top
row of the sheet... and all else to follow the x,xx,15 clicks.

Thanks.



"Jim Thomlinson" wrote:

There is no on click event in Excel (there is for embeded buttons but not for
cells). There is selection change, but that will not fire if you click the
same cell twice in a row. How about double click? Place this code directly
into the sheet (right click the approporiate tab and select view code. Paste
the following

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Select Case Target.Value
Case Empty
Target.Value = "x"
Case "x"
Target.Value = "xx"
Case "xx"
Target.Value = 15
End Select

End Sub
--
HTH...

Jim Thomlinson


"PG Oriel" wrote:

I am a school teacher and use my interactive whiteboard a lot, which is away
from my keyboard. I have a spreadsheet which I log behavioural issues in with
a x, xx, 15 depending on severity of warning.

I have this in the background and open it when i need to input my warnings.
This involves me going to my desk and keying it in.

Is there a way to click on a cell with the mouse, change it to a x, then if
I click a second time to change it to a xx, and then on 3rd click to 15.

I can do it using buttons, but is there any way to do it using a clicking
sequence ona cell only??? Thanks!!!

  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Two double click events???

Here you go...

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
If Target.Row = 1 Then
Target.Value = Date
Else
Select Case Target.Value
Case Empty
Target.Value = "x"
Case "x"
Target.Value = "xx"
Case "xx"
Target.Value = 15
Case 15
Target.Value = "I'm calling your mom"
End Select
End If
End Sub
--
HTH...

Jim Thomlinson


"PG Oriel" wrote:

Hello again...

Now I have that in the code, is there a way to, again, use a double click to
turn blank cells into the day's date. I just want this to work for the top
row of the sheet... and all else to follow the x,xx,15 clicks.

Thanks.



"Jim Thomlinson" wrote:

There is no on click event in Excel (there is for embeded buttons but not for
cells). There is selection change, but that will not fire if you click the
same cell twice in a row. How about double click? Place this code directly
into the sheet (right click the approporiate tab and select view code. Paste
the following

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Select Case Target.Value
Case Empty
Target.Value = "x"
Case "x"
Target.Value = "xx"
Case "xx"
Target.Value = 15
End Select

End Sub
--
HTH...

Jim Thomlinson


"PG Oriel" wrote:

I am a school teacher and use my interactive whiteboard a lot, which is away
from my keyboard. I have a spreadsheet which I log behavioural issues in with
a x, xx, 15 depending on severity of warning.

I have this in the background and open it when i need to input my warnings.
This involves me going to my desk and keying it in.

Is there a way to click on a cell with the mouse, change it to a x, then if
I click a second time to change it to a xx, and then on 3rd click to 15.

I can do it using buttons, but is there any way to do it using a clicking
sequence ona cell only??? Thanks!!!

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Two double click events???

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Range, Cancel As Boolean)
Cancel = True
if Target.row < 1 then
Select Case Target.Value
Case Empty
Target.Value = "x"
Case "x"
Target.Value = "xx"
Case "xx"
Target.Value = 15
End Select
Else
Target.Value = Date
Target.Numberformat = "mm/dd/yyyy"
End if
End Sub

--
Regards,
Tom Ogilvy


"PG Oriel" wrote in message
...
Hello again...

Now I have that in the code, is there a way to, again, use a double click

to
turn blank cells into the day's date. I just want this to work for the top
row of the sheet... and all else to follow the x,xx,15 clicks.

Thanks.



"Jim Thomlinson" wrote:

There is no on click event in Excel (there is for embeded buttons but

not for
cells). There is selection change, but that will not fire if you click

the
same cell twice in a row. How about double click? Place this code

directly
into the sheet (right click the approporiate tab and select view code.

Paste
the following

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Select Case Target.Value
Case Empty
Target.Value = "x"
Case "x"
Target.Value = "xx"
Case "xx"
Target.Value = 15
End Select

End Sub
--
HTH...

Jim Thomlinson


"PG Oriel" wrote:

I am a school teacher and use my interactive whiteboard a lot, which

is away
from my keyboard. I have a spreadsheet which I log behavioural issues

in with
a x, xx, 15 depending on severity of warning.

I have this in the background and open it when i need to input my

warnings.
This involves me going to my desk and keying it in.

Is there a way to click on a cell with the mouse, change it to a x,

then if
I click a second time to change it to a xx, and then on 3rd click to

15.

I can do it using buttons, but is there any way to do it using a

clicking
sequence ona cell only??? Thanks!!!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Click in cell to run macro alistew Excel Discussion (Misc queries) 7 February 20th 07 05:03 PM
Macro on cell click?? Jim Thomlinson[_5_] Excel Programming 0 February 6th 06 09:33 PM
Macro on cell click?? Gary''s Student Excel Programming 0 February 6th 06 09:29 PM
Run Macro on Cell Click.. CliffHanger9 Excel Programming 0 November 17th 04 07:46 PM
Run Macro on Cell Click.. scottymelloty[_12_] Excel Programming 1 November 17th 04 06:15 PM


All times are GMT +1. The time now is 03:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"