calling a worksheet function from another worksheet in same workbo

  • Thread starter Thread starter Liz
  • Start date Start date
L

Liz

I know that I should know how to do this, but I am obviously having a "blank"
moment. Can anyone help?

I want to call some code in the "Deactivate" event of one worksheet from
another worksheet.
 
Sheet1.Worksheet_Deactivate

worked for me.

You'll have to make it Public though (or expose it through another Public
procedure).

Tim
 
Tim, thanks for the reply. I did not put down my question correctly. What I
want to do is on the Deactivate event of one worksheet, call a Function
("UpdChartMonth") that is a public function on another worksheet. The purpose
of UpdChartMonth is to update a chart on this "other" worksheet as a result
of changes being made on the first worksheet. Tks!
 
Assuming that you have a function called UpdChartMonth,

In your Deactivate procedure have you tried entering the line:

UpdChartMonth()
 
Similar to before:

Sheet1.UpdChartMonth

(adjusted based on the codename of the sheet containing UpdChartMonth)

Tim
 
Tim, thanks for the quick response and, of course, you are correct!

Major Duh! moment!

Tks muchly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top