kickthecow
06-20-2008, 04:56 PM
This is probably an easy thing to do, but I've never been good at coding, so here I am :-)
So far I've drawn a box (which I'm calling a button) on my spreadsheet, to which I assigned a macro that I called Activate.
What I want to happen is, every time I click the Activate button, a random integer will appear in a cell that I called Magic.
I'm not sure if I need to enter "=Rand()" in the Magic cell and then somehow write a macro that would refresh the number every time I click the Activate button, or if I need to write the Activate macro so that it generates and outputs the number on its own. I would prefer the former, because that will be easier for me to work with. If I can just get the button to refresh the random number output in the Magic cell, I can handle the rest.
So far I have pretty much nothing:
Sub Activate()
Magic.?
End Sub
The purpose of this, if you're interested, is that I want to make a numbered list of all the things we like to eat in our family so that when I click a button, a random food item will be selected and we can decide what to eat for dinner! Eliminate the arguing, right?
Anyways, any help is greatly appreciated! Thanks!
So far I've drawn a box (which I'm calling a button) on my spreadsheet, to which I assigned a macro that I called Activate.
What I want to happen is, every time I click the Activate button, a random integer will appear in a cell that I called Magic.
I'm not sure if I need to enter "=Rand()" in the Magic cell and then somehow write a macro that would refresh the number every time I click the Activate button, or if I need to write the Activate macro so that it generates and outputs the number on its own. I would prefer the former, because that will be easier for me to work with. If I can just get the button to refresh the random number output in the Magic cell, I can handle the rest.
So far I have pretty much nothing:
Sub Activate()
Magic.?
End Sub
The purpose of this, if you're interested, is that I want to make a numbered list of all the things we like to eat in our family so that when I click a button, a random food item will be selected and we can decide what to eat for dinner! Eliminate the arguing, right?
Anyways, any help is greatly appreciated! Thanks!