How do I run my code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have three pieces of code. Depending on the value of a specific cell I want
one of these bits of code to run. The code doesn’t assign a value to a cell
but sets another cells validation list.

How can I get this code to run automatically? If it was Access I would
assign the code to the on change event of the field, but I don’t know if this
is possible in Excel…
 
You would use a Worksheet_Change event macro. Within the macro, you would
write code to continue execution only when that specific cell's value
changes. Subsequent code would do what you want for the specific value
entered. Post back if you need further help with this. Include more detail
about what you have and what you want to happen. HTH Otto
 
What I have is a sheet for users to fill in where they have been that week.
So each sheet will have 10 - 15 rows that will all require the same code to
run, but of cource the cell that is being looked at and the cell that is
being updated will be different.

For example cell F5 has a validation list with three options. Acute, Primary
and Other. Depending what option the user selects means the validation list
for cell G5 will change.

I have the three lists defind as named ranges on another sheet.

So if F5 says Acute then the Acute list is shown for cell G5, and if cell F6
has Primary then cell G6 will have the Primary list to select from.

I hope that makes sence.
 
I have a sheet that logs what type of call a rep has made. The sheet can
have 10 – 15 entries on it. So whit will happen is:

Cell F5 has a validation list assigned to it with three values. Acute,
Primary and Other. Depending on which option is selected I want the cell G5
to have its validation list changed to represent the options for the value in
F5. All the lists have been defined on another sheet as named ranges.

As above this will be the same for the other rows. So the value set in F6
will effect the validation list for G6.

I hope this makes sence.
 
Back
Top