ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Tom Ogilvy (https://www.excelbanter.com/excel-programming/310354-re-tom-ogilvy.html)

Jonsson

Tom Ogilvy
 
Hi Tom

I think I lost you in previous discussion.

However, your code for changing text on one button works great, but when
trying the code for changing 30 buttons, I get a "compile Error" in
codeline:

If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then

Can you help me with that, please!

//Thomas





Chip Pearson

Tom Ogilvy
 
If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then


You're missing a " after A31.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Jonsson" wrote in message
...
Hi Tom

I think I lost you in previous discussion.

However, your code for changing text on one button works great,
but when
trying the code for changing 30 buttons, I get a "compile
Error" in
codeline:

If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then

Can you help me with that, please!

//Thomas







Tom Ogilvy

Tom Ogilvy
 
Its worse than that
If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then

Should be

If not Intersect(Target, Range("A2:A31")) is Nothing _
And Target.Value < "" Then

but I posted a tested version in the original thread. (tested against my
assumptions as stated).


--
Regards,
Tom Ogilvy


"Chip Pearson" wrote in message
...
If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then


You're missing a " after A31.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Jonsson" wrote in message
...
Hi Tom

I think I lost you in previous discussion.

However, your code for changing text on one button works great,
but when
trying the code for changing 30 buttons, I get a "compile
Error" in
codeline:

If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then

Can you help me with that, please!

//Thomas









Jonsson

Tom Ogilvy
 
Thanks, now it's working great!
What if I have the buttons in a range B9:F26. Obviosly the code wont work,
I can see that.
What has to be changed and how?

//Thomas
"Tom Ogilvy" skrev i meddelandet
...
Its worse than that
If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then

Should be

If not Intersect(Target, Range("A2:A31")) is Nothing _
And Target.Value < "" Then

but I posted a tested version in the original thread. (tested against my
assumptions as stated).


--
Regards,
Tom Ogilvy


"Chip Pearson" wrote in message
...
If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then


You're missing a " after A31.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Jonsson" wrote in message
...
Hi Tom

I think I lost you in previous discussion.

However, your code for changing text on one button works great,
but when
trying the code for changing 30 buttons, I get a "compile
Error" in
codeline:

If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then

Can you help me with that, please!

//Thomas











Tom Ogilvy

Tom Ogilvy
 
B9:F26 is only half the story. Where does the button over B9 get its value
from (to use as the caption). How about the buttons over B10, Button over
F26?

--
Regards,
Tom Ogilvy

"Jonsson" wrote in message
...
Thanks, now it's working great!
What if I have the buttons in a range B9:F26. Obviosly the code wont

work,
I can see that.
What has to be changed and how?

//Thomas
"Tom Ogilvy" skrev i meddelandet
...
Its worse than that
If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then

Should be

If not Intersect(Target, Range("A2:A31")) is Nothing _
And Target.Value < "" Then

but I posted a tested version in the original thread. (tested against

my
assumptions as stated).


--
Regards,
Tom Ogilvy


"Chip Pearson" wrote in message
...
If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then

You're missing a " after A31.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Jonsson" wrote in message
...
Hi Tom

I think I lost you in previous discussion.

However, your code for changing text on one button works great,
but when
trying the code for changing 30 buttons, I get a "compile
Error" in
codeline:

If not Intersect(Target.Address, Range("A2:A31)) is Nothing _
And Target.Value < "" Then

Can you help me with that, please!

//Thomas














All times are GMT +1. The time now is 07:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com