Float button on current row

vabtroni

New Member
Joined
Aug 1, 2017
Messages
43
Office Version
  1. 365
Platform
  1. Windows
Greetings everyone.

I have a button called "but_ENV_AVARIAS" wich runs a macro, and I need it to float on the current selected row near column I (with a fixed horizontal position), except if:
- current row is above row 8
- current row is below row 30007
...meaning, if selected row is not between rows 8 and 30007, I would like that button to become invisible.

Is there any chance I could put it on VBA?

Best regards,
Vasco.
 
...and if I select column I outside the range 8-3007, it returns the same error, highlighting the line:

Code:
ActiveSheet.Shapes.Range("but_ENV_AVARIAS").Visible = False
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Your script is returning runtime error 1004 whenever the is set to be visible or invisible, I believe.
 
Upvote 0
Your script is returning runtime error 1004 whenever the button is set to be visible or invisible, I believe.
 
Upvote 0
...and if I select column I outside the range 8-3007, it returns the same error, highlighting the line:

Code:
ActiveSheet.Shapes.Range("but_ENV_AVARIAS").Visible = False

Did the script work when inside the range?

Is this the proper name of the button? "but_ENV_AVARIAS"

Do you have any other sheet event scripts in this sheet?
If so show them to me
 
Last edited:
Upvote 0
Did the script work when inside the range?

Is this the proper name of the button? "but_ENV_AVARIAS"

Do you have any other sheet event scripts in this sheet?
If so show them to me

Yes, it recognizes the range.

Yes, it is the proper name of the button.

No other event scripts in this sheet
 
Upvote 0
So tell me what is it doing or not doing.
Is it working inside the range?

You started off saying it did not work outside the range and never said if it works inside the range.

Are using a "Apple" computer?
What version of Excel?

Yes, it recognizes the range.

Yes, it is the proper name of the button.

No other event scripts in this sheet
 
Upvote 0
So tell me what is it doing or not doing.
Is it working inside the range?

You started off saying it did not work outside the range and never said if it works inside the range.

Are using a "Apple" computer?
What version of Excel?

I am so so sorry, I mislead you!!! I was wrong in one thing, there was a mistake on the name of the object.

Your script is WORKING :-D :-D oh so fine!!!! :-)

Thank you in advance, but now I'd like to ask you something: is there a way to "tune" it a little better to these conditions:
- instead of working only in the "I:I" range, I'd like it to work on range "A:K", I mean, whenever I select any cell on the row, the button is allways placed on this same current row, but next to column "I", no matter what column I have selected on the current row.

Thank you so so much!!!! :-D
 
Upvote 0

Forum statistics

Threads
1,224,832
Messages
6,181,234
Members
453,026
Latest member
cknader

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top