How find if target is object in Worksheet_Change (ByVal Target As.. ?)

  • Thread starter Gunnar Johansson
  • Start date
G

Gunnar Johansson

Hi,

A / I need to act different if the target of change is a checkbox or if it
is a range (or cell).

B / I also need to be able to separate what specific checkbox is changing. I
need to run different subroutines depending on which checkbox is changing.

Kan anyone give me a hint how to do this?

Regards
Gunnar
 
B

Bob Phillips

A checkbox doesn't trigger the Worksheet_Change event.

You need to identify this in the checkbox event or macro.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
G

Gunnar Johansson

Oh yes, thats right! - that explains why I used Worksheet_Calculate as
trigger today. Ít was a while since I wrote this code. I used the fact that
checking calculate a "false/true" information in a hidden cell.

I haven't worked with objects so much earlier, and need now even more help -
can I continue to use ws_Calculate or am I on the wrong road?

Grateful to any help

Regards
Gunnar
 
B

Bob Phillips

Gunnar,

I think you are on the wrong road. You can't use any worksheet event for
controls, as they are not part of worksheet, but on a separate virtual
layer.

Control toolbox controls have their own events (click, etc.), whereas Forms
controls are assigned macros. You need to work through these.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Top