Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Command button

Here is what I wnt to do. I will use +INT(RAND()*(100-1)+1) to generate a
number but i do not wnat to use the function key F9 to do this. Would liek a
command button to push and have ti generate the number in cell below. I do
not under stand the command buton but knwo how to get on up but that is it.
Please help!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Command button

you can use the control toolbox to place a command button on the
worksheet. right click the button & choose properties to edit text on
button, etc.
double-click on button to automatically open code editor to correct
location.
code would be something like:

dim rRange as range
dim sFormula as string

set rRange = activecell
sFormula = "=+INT(RAND()*(100-1)+1)"

worksheet.range(rRange).offset(1,0) = sFormula


so every time you click the worksheet button, the cell you are on when
you click it will have the formula entered in the cell below.
modify formula as necessary.
hope this helps!
susan


On Apr 20, 7:40 am, Khanjohn
wrote:
Here is what I wnt to do. I will use +INT(RAND()*(100-1)+1) to generate a
number but i do not wnat to use the function key F9 to do this. Would liek a
command button to push and have ti generate the number in cell below. I do
not under stand the command buton but knwo how to get on up but that is it.
Please help!!



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
command button add another command Wanna Learn Excel Discussion (Misc queries) 5 December 7th 08 11:42 PM
VB's Command Button vs Form's Command Button Ronald Dodge Excel Programming 3 May 24th 06 02:23 PM
Command Button vs Form Button Bri[_3_] Excel Programming 2 February 3rd 06 08:18 AM
Command Button vs Control Button RGibson Excel Programming 1 October 14th 03 02:24 AM
Command Button vs Form Button T K Excel Programming 4 August 26th 03 07:26 PM


All times are GMT +1. The time now is 12:16 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"