+ Reply to Thread
Results 1 to 11 of 11

Cursor Navigation Help

  1. #1
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Cursor Navigation Help

    Hi All,

    I've had a couple of questions answered tonight, you guys have been a great help!

    Very last question before I hit the sack.

    Riddle me this....

    If the following code moves the cursor 1 place to the left,

    Please Login or Register  to view this content.
    What would I need to change in order for the cursor to be moved 1 row up and 1 cell to the right.

    I've tried multiple changes, but to be honest I'm just guessing.

    Thanks all.
    Darren

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Cursor Navigation Help

    perhaps
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Re: Cursor Navigation Help

    Hi Joseph,

    Unfortunately does not have the desired effect, cursor does not move.

    Darren

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Cursor Navigation Help

    then perhaps
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Re: Cursor Navigation Help

    Hi Joseph,

    Same non movement on cursor, but this time it crashed excel,

    Darren

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,604

    Re: Cursor Navigation Help

    Please Login or Register  to view this content.
    Ben Van Johnson

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Cursor Navigation Help

    Hi Darren,

    The guys above are a lot smarter than I am.
    Where your current cursor is at is given by:

    Cells(Activecell.Row,Activecell.Column)

    If you want to go one row down and 2 columns to the right you would do a:

    Cells(Activecell.Row + 1 ,Activecell.Column + 2).Select

    I don't like or use the "Offset" statement much. I like to use the "Cells( row , column)" notation.
    Last edited by MarvinP; 03-25-2013 at 01:39 AM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  8. #8
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Re: Cursor Navigation Help

    It clearly must be me causing the error as this code doesnt seem to work either.

    Darren

  9. #9
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Re: Cursor Navigation Help

    Quote Originally Posted by MarvinP View Post
    Hi Darren,

    The guys above are a lot smarter than I am.
    Where your current cursor is at is given by:

    Cells(Activecell.Row,Activecell.Column)

    If you want to go one row down and 2 rows to the right you would do a:

    Cells(Activecell.Row + 1 ,Activecell.Column + 2).Select

    I don't like or use the "Offset" statement much. I like to use the "Cells( row , column)" notation.
    Hi Marvin,

    I think the issue is that I only want move if the cell is not locked

    The funny thing is that the very first piece of code works correctly for moving to the first unlocked cell to the left.

    Just trying to do exactly the same thing but moving up 1 row and across 1 cell to the right.

    Darren

  10. #10
    Registered User
    Join Date
    08-21-2012
    Location
    Heckmondwike, England
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    54

    Re: Cursor Navigation Help

    Hi Marvin,

    Your suggestion actually worked perfectly, much simpler method.

    Thanks again
    Darren

  11. #11
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Cursor Navigation Help

    Darren,
    I apologize for not testing the code-the With statement was stopping it working properly
    Please Login or Register  to view this content.
    would have been a better amendment although I agree that not using offset is often simpler

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1