• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to have a floating button in the attached file ?

I have a button in the locked sheet. The Password is 123. i want the button to float when i scroll down.
 

Attachments

  • MISC_ACCOUNT_NEW.xlsm
    31.2 KB · Views: 3
Difficult with a button, easier to use a non modal user form or​
the easy way for a button is to place it in the first row and freeze the panes​
so the first row - and the button - stays visible when you scroll down …​
 
In your Worksheet_SelectionChange sub, do something along these lines before the sub is exited:
Buttons("Button 2").Top = Cells(ActiveWindow.ScrollRow + 1, 1).Top
or:
Buttons("Button 2").Top = ActiveCell.Top + 5
 
Difficult with a button, easier to use a non modal user form or​
the easy way for a button is to place it in the first row and freeze the panes​
so the first row - and the button - stays visible when you scroll down …​
Please elaborate on how to do this. The 1st row is supposed to be hidden. And also i don't know how to place the button in the second row.
 
In your Worksheet_SelectionChange sub, do something along these lines before the sub is exited:
Buttons("Button 2").Top = Cells(ActiveWindow.ScrollRow + 1, 1).Top
or:
Buttons("Button 2").Top = ActiveCell.Top + 5
Hi! p45cal, thanks for your suggestion. As i'm not an expert in VBA, so please tell me where to exactly place the line.
 
I'm not going to be able to open any Excel file for a day or two so all I can suggest in the interim is to right - click the sheet concerned's tab and choose View code... then directly after the Sub Worksheets_change line paste in one of my suggestions.
 
I'm not going to be able to open any Excel file for a day or two so all I can suggest in the interim is to right - click the sheet concerned's tab and choose View code... then directly after the Sub Worksheets_change line paste in one of my suggestions.

Dear P45cal, thank you so much for the help. I did as you had suggested, and it really works. This one worked - Buttons("Button 2").Top = ActiveCell.Top + 5.
The 1st one didn't work, maybe i didn't do it right. Well anyways the 2nd one worked fine. Now whenever i click after scrolling down the sheet, the Button follows the current screen.
Thanks once again
 
Back
Top