Only want macro to apply to specific cells

Lifeseeker

Registered User.
Local time
Today, 12:52
Joined
Mar 18, 2011
Messages
273
Hi there,

I attached a random number generator in Excel file with two buttons and macros.

What's a little bit annoying is that every time a button is clicked, I get two numbers generated. Ideally, I would only want to generate one new number, depending on which button is clicked.

I think this is because of the syntax written in vba code, but I"m not sure how to get around it.

Code I used is... activecell.formular1c1..... If I want a new storage #, then I only want a new storage # to be generated, not the account # and vice versa.

Does anybody have any ideas/comments?

Thank you very much
 

Attachments

The 2 orange "cells" contain the formulas and thus get recalculated each time a madro is run, if you select elsewhere the selected cell contains the calculation for which ever button is selected and the 2 orange cells also change.

Brian
 

Users who are viewing this thread

Back
Top Bottom