getting macro on specific filled cell click

G

Guest

Hello, im hoping someone can help,

is there a way to create some code that will make any black filled cell in
the B colomn run a specific macro when it is clicked on. becuase i have used
this,

If Intersect(Target, Me.Range("b23,b71")) Is Nothing Then
'do nothing
Else
duplicator
End If

to get it to do it on certain cells, but the macro that runs inserts two
rows into the worksheet which then means the cells listed arent actually
relevant to their initial row no's. so it all goes out of sync. so if there
was a way it would only let the click --> macro happen on the black cells
then it cant go wrong!

Thanks,,

WK
 
G

Guest

Consider assigning a Named Range in the worksheet and then testing Intersect
Target with that range.

The Named Range will adjust as rows/columns are added/deleted
 

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