Re: Counting, command button and programming in VB

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Forgot this bit,

'In the Excel window, go 'View' > 'Toolbars' > 'Forms' and left click the command
button which is the second one down on the right,'

After that, left click anywhere in the Excel window,
Alan.
"Alan" <alan111@xxxxxxxxxxxx> wrote in message news:uBMXxLwVHHA.4624@xxxxxxxxxxxxxxxxxxxxxxx
Assuming its just a single cell you want to increment,
Hit Alt and F11 to open the VB Editor,
Click 'Insert' on the top toolbar and click 'Module' (not 'Class Module')
Copy and paste this code into the blank window of the module,

Sub Increment()
Range("A1") = Range("A1") + 1
End Sub

Change the range from A1 to suit your needs,
If you want it do the same on any selected cell use,

Sub Increment()
ActiveCell = ActiveCell + 1
End Sub

Exit the VB Editor, (just click the top right 'X')
In the Excel window, go 'View' > 'Toolbars' > 'Forms' and click the command button which is the second one down on the right,
Right click it and go 'Assign Macro' and select 'Increment' which will be the only option unless you have other macro's in the file,
Right click it again and edit the text from 'Command Button1' to whatever you want to call it, right click again and drag it where you want it on the screen and there you go,
Regards,
Alan.
"ElFrodo" <ElFrodo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:8E392899-77E3-41BA-86CA-5731D247E2E4@xxxxxxxxxxxxxxxx
Need to create a command button that count, in a single cell, each time I
press it. I press it ones, and in a1 it says 1. I press it one more time, and
a1 says 2 and so one. I can’t use VB, so if anyone can help me, I need the
whole programming.

Appreciate any help.

ElFrodo



.



Relevant Pages

  • Re: Counting, command button and programming in VB
    ... "ElFrodo" wrote in message ... Alan skrev: ... Sub Increment() ... Right click it again and edit the text from 'Command Button1' to whatever ...
    (microsoft.public.excel.misc)
  • libata PATA todo list
    ... and some are from a list Alan was kind enough to create. ... Simplex means that only one command can be outstanding, ... Possibly some hosts also need Simplex DMA, ... Some older ATAPI devices require the OS driver to wait for an interrupt, ...
    (Linux-Kernel)
  • Re: Windows Update page hangs indefinitely
    ... I pasted in that command and received an error message saying it failed-- the ... Alan G. ... > Some have posted that registering MSXML3.DLL fixed this problem. ... > torgeir, Microsoft MVP Scripting, Porsgrunn Norway ...
    (microsoft.public.windowsupdate)
  • Re: Attention all LanMan98 users
    ... last night) show LanMan98 sending a close command with a date/ ... command and ignores the subsequent updates. ... but LanMan98 rendered them as ... Now if I could only sort out permissions - as Alan on Windows I can ...
    (comp.sys.acorn.networking)
  • Re: Have perl increment a number that shows up before a delimiter
    ... > introduce this on the command line and have the script increment this ... There is no newline if you have entered the filename on the command ...
    (comp.lang.perl)