These work:
These does not:
Why is that?
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With ActiveSheet.CommandButton1
.Top = ActiveWindow.ScrollRow * [COLOR=#ff0000]Rows(ActiveWindow.ScrollRow).Height[/COLOR] - [COLOR=#ff0000]14[/COLOR]
End With
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim intCellHeight As Integer: intCellHeight = Rows(ActiveWindow.ScrollRow).Height
With ActiveSheet.CommandButton1
.Top = ActiveWindow.ScrollRow * [COLOR=#ff0000]Rows(ActiveWindow.ScrollRow).Height[/COLOR] - [COLOR=#ff0000]intCellHeight[/COLOR]
End With
End Sub
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With ActiveSheet.CommandButton1
.Top = ActiveWindow.ScrollRow * [COLOR=#ff0000]14 [/COLOR]- [COLOR=#ff0000]14[/COLOR]
End With
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim intCellHeight As Integer: intCellHeight = Rows(ActiveWindow.ScrollRow).Height
With ActiveSheet.CommandButton1
.Top = ActiveWindow.ScrollRow * [COLOR=#ff0000]intCellHeight [/COLOR]- [COLOR=#ff0000]14[/COLOR]
End With
End Sub
Last edited: