Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Counting, command button and programming in VB

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 cant use VB, so if anyone can help me, I need the
whole programming.

Appreciate any help.

ElFrodo

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 492
Default Counting, command button and programming in VB

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" wrote in message
...
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 cant use VB, so if anyone can help me, I need the
whole programming.

Appreciate any help.

ElFrodo


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 492
Default Counting, command button and programming in VB

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" wrote in message
...
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" wrote in message
...
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 cant use VB, so if anyone can help me, I need
the
whole programming.

Appreciate any help.

ElFrodo



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Counting, command button and programming in VB

Thanks Alan:)

Its nice of you to respond so fast.

Have a nice day and soon a good weekend.

Best regards from Norway.

ElFrodo

Alan skrev:

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" wrote in message
...
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 cant use VB, so if anyone can help me, I need the
whole programming.

Appreciate any help.

ElFrodo



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 492
Default Counting, command button and programming in VB

Best Regards from London, let me know if it works! It should do,
Alan.

"ElFrodo" wrote in message
...
Thanks Alan:)

Its nice of you to respond so fast.

Have a nice day and soon a good weekend.

Best regards from Norway.

ElFrodo

Alan skrev:

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" wrote in message
...
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 cant use VB, so if anyone can help me, I need
the
whole programming.

Appreciate any help.

ElFrodo






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Counting, command button and programming in VB

Hey.

Its working perfectly.
It took some time, because my Excel is in Norwegian and hade to find the
right menu and buttons.

Thanks again.

ElFrodo

Alan skrev:

Best Regards from London, let me know if it works! It should do,
Alan.

"ElFrodo" wrote in message
...
Thanks Alan:)

Its nice of you to respond so fast.

Have a nice day and soon a good weekend.

Best regards from Norway.

ElFrodo

Alan skrev:

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" wrote in message
...
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 cant use VB, so if anyone can help me, I need
the
whole programming.

Appreciate any help.

ElFrodo





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
VBA Command Button IntricateFool Excel Discussion (Misc queries) 5 December 8th 06 04:39 AM
Programming a "Save as..." command button within Excel DavidHawes Excel Discussion (Misc queries) 2 November 13th 06 02:48 PM
Command button CEG Excel Discussion (Misc queries) 1 May 4th 06 09:54 PM
command button abfabrob Excel Discussion (Misc queries) 5 October 7th 05 12:54 AM
command button Mike New Users to Excel 1 August 30th 05 01:39 AM


All times are GMT +1. The time now is 10:35 PM.

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

About Us

"It's about Microsoft Excel"