Link to home
Start Free TrialLog in
Avatar of Omar Khaled
Omar Khaled

asked on

floating buttons while scrolling on excel using vba

I had this question after viewing Excel - Floating Command Button.

Hi,

How do I do the same for multiple buttons? lets say I have button 1, button 2 and button 3?
ASKER CERTIFIED SOLUTION
Avatar of Shums Faruk
Shums Faruk
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Omar Khaled
Omar Khaled

ASKER

Hi,

Thank you very much. Can you help with making each button fixed to Col 16 for example and row 16,17 and 18?

here is what I have for one button

Const iCOL_RESTR As Integer = 16
Const iROW_ROW As Integer = 16

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Dim cmdBtn As Shape
   
    Set cmdBtn = Me.Shapes("BUTTON 152")
   
    cmdBtn.Left = Me.Columns(iCOL_RESTR).Left
    cmdBtn.Top = ActiveWindow.VisibleRange.Top + 0.6 * ActiveWindow.VisibleRange.Height
   
If ActiveSheet.Name <> "Data Staging" Then
ActiveSheet.Name = "Data Staging"
End If
End Sub
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok how about fix button 2 to a different col?
Got it. Thanks. How about:

Attach a macro to a button. When I click the button, excel automatically selects Cell A102, then when I click it again it selects A202 and so on till 12002 or indefinitly. How do I do it?
I believe, you already raised another question for your second query. If your first query solved your purpose you can close this question. We may continue on other.
Martin Sir already replied on your second question.
Thank you for you quick response and excellent answer.
You're Welcome Omar! Glad I was able to assist :)