Clock problem

007

New Member
Joined
May 21, 2003
Messages
11
My problem is probably quite simple, as i am only a beginner with excel. But here goes, im attempting to use formula's and functions to create a very short football game, based on IF's and VLOOKUP's, particularly. However i need for a cell to +1 every time i press ENTER/DELETE to recalculate the entire sheet (if that makes any sense?) Is their a quick solution, or even a long solution?

ANY help what so ever would be great.

Steve
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Please any help, i might have made the problem sound more difficult than it is. When i said recalculate entire page i mean't that whenever you use VLOOKUP, every time you press delete the page does recalculate, that isn't my problem.

All i want is for a cell to +1 each time i press delete
 
Upvote 0
take a look in vba help at OnKey Method...this will tell you what you want to know.

In "This Workbook"

sub a()

Application.OnKey "{DEL}","MyMacro"

End Sub

then have a macro called MyMacro

Sub MyMacro()

Sheets("sheename").Cells(cellref eg for A1 - 1,1) = Sheets("sheetname").Cells(cellref) + 1

End Sub
 
Upvote 0
thank you for replying, where exactly is vba help?
also the text string you typed is that a macro that will make it work, sorry im a beginner! :(
 
Upvote 0
I will send you a blank workbook which you can muck about with...vba in there already...

to view VBA - hit ALT+F11
 
Upvote 0
Hi

I went to UWE - what cam[pus are you on - Frenchay?

I have found a way to do this using the last posts to this thread.

in THIS WORK BOOK PASTE

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Application.OnKey "{DEL}", "MyMacro"
End Sub


IN MODULE 1 PASTE

Sub MyMacro()

Range("e8").Value = Range("e8").Value + 1
End Sub


Then change E8 to the cell you want to change.

On the pressing of Delete - E8 wil rise by 1 each time.

What course are you on?

Stuart
 
Upvote 0
OK Mail sent

Four macros...

1. Workbook Open event to activate OnKey
2. Macro that activates OnKey and links to your cell increasing macro
3. Macro that increases cell value
4. Workbook Close event that restores Delete key to normal function.
 
Upvote 0
when u say 'this work book' what exactly do you mean, thanks alot for your help, it is exactly what i want, just gotta do it now.

Im on Frenchay campus, my name is steve and im studying Architecture & Planning. what did you study stu?
 
Upvote 0

Forum statistics

Threads
1,221,706
Messages
6,161,406
Members
451,703
Latest member
rvan07

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top