No. I have a worksheet that contains some visual basic code that says when
you reach row 11 in any given cell please jump to the next cell to the
(right) row 1.
Now I would like to be able to force my position to the next cell (right)
row 1 evan if I don't reach row 11. I thought I could do that with a Macro
like Cntl J.
ok, Programming Cells if I understood correctly what you are trying to
achieve the following should work.
Sub MoveTo()
Dim CurRow, CurCol
CurRow = ActiveCell.Row
CurCol = ActiveCell.Column
If CurRow >= 11 Then
Cells(1, CurCol + 1).Select
End If
End Sub
You MUST include the following to the sheet you are working so that your
cell position is checked.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MoveTo
End Sub
By changing the ">=11" part of the MoveTo sub you can define the desired row
number after which the cursor should move to row 1 of the next column.
> No. I have a worksheet that contains some visual basic code that says when
> you reach row 11 in any given cell please jump to the next cell to the
[quoted text clipped - 14 lines]
> >
> > - John
John Michl - 12 Aug 2005 19:35 GMT
I understood the request a little differently than Markos. If you want
to create a hot-key so that when pressed, no matter the location, you
got to the top of the next column, the following should work. After
creating the code in VB, assign a hot-key via the Tools | Macro
windows.
Sub GoTop()
Cells(1, ActiveCell.Column + 1).Select
End Sub
- John
Programming Cells - 12 Aug 2005 19:55 GMT
So that I understand correctly:
My worksheet code looks like this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row = 11 Then
Target.Offset(1 - Target.Row, 1).Select
End If
End Sub
Sub GoTop()
Cells(1, ActiveCell.Column + 1).Select
End Sub
My Macro looks like this:
Sub Macro1()
'
' Macro1 Macro
' Jump to the next cell row 1
'
' Keyboard Shortcut: Ctrl+y
'
End Sub
> I understood the request a little differently than Markos. If you want
> to create a hot-key so that when pressed, no matter the location, you
[quoted text clipped - 7 lines]
>
> - John
Markos Mellos - 12 Aug 2005 22:01 GMT
Programming Cells, John seems to have undestood better your need.
The Sub GoTop() is all you need. Then go to Tools / Macro / Macros / GoTop
and
in the options define the desired shortcut key.
> So that I understand correctly:
>
[quoted text clipped - 36 lines]
> >
> > - John