Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.Shapes("CommandButton1").Top = ActiveCell.Top
ActiveSheet.Shapes("CommandButton1").Left = ActiveCell.Left
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
ActiveSheet.Shapes("CommandButton1").Top = ActiveCell.Top
ActiveSheet.Shapes("CommandButton1").Left = ActiveCell.Left
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
ActiveSheet.Shapes("CommandButton1").Top = ActiveCell.Top
ActiveSheet.Shapes("CommandButton1").Left = ActiveCell.Offset(0, 1).Left
End Sub
first time click to edit cell,double click to call command button right..might be helpful in some places
is it not possible with scrolling bar (Bottom Right)?
Option Explicit
Private eTime
Sub ScreenRefresh()
With ThisWorkbook.Worksheets("Sheet1").Shapes(1)
.Left = ThisWorkbook.Windows(1).VisibleRange(2, 2).Left
.Top = ThisWorkbook.Windows(1).VisibleRange(2, 2).Top
End With
End Sub
Sub StartTimedRefresh()
Call ScreenRefresh
eTime = Now + TimeValue("00:00:01")
Application.OnTime eTime, "StartTimedRefresh"
End Sub
Sub StopTimer()
Application.OnTime eTime, "StartTimedRefresh", , False
End Sub
Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopTimer
End Sub
Private Sub Workbook_Open()
StartTimedRefresh
End Sub
.Left = ThisWorkbook.Windows(1).VisibleRange(2, 2).Left
.Top = ThisWorkbook.Windows(1).VisibleRange(2, 2).Top