Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / August 2005

Tip: Looking for answers? Try searching our database.

Create a Macro to jump to next cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Programming Cells - 12 Aug 2005 16:11 GMT
How Do I create a Macro that will allow me to jump to the next Cell Row 1 no
matter where my current position is?
John Michl - 12 Aug 2005 16:20 GMT
Are you trying to move your cursor to the left after data entry?  If
so, a macro is not needed.  Change your options settings.  Depending on
your version of Excel it is something like:

Tools | Options | Edit | Move Selection after Enter (right)

If that is not what you are trying to do, add a little more detail
about your application.

- John
Programming Cells - 12 Aug 2005 16:27 GMT
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.

> Are you trying to move your cursor to the left after data entry?  If
> so, a macro is not needed.  Change your options settings.  Depending on
[quoted text clipped - 6 lines]
>
> - John
Markos Mellos - 12 Aug 2005 19:19 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.