Consulting

Results 1 to 4 of 4

Thread: Syntax for Set_Cursor_Pos()

  1. #1
    VBAX Newbie
    Joined
    Oct 2012
    Posts
    4
    Location

    Syntax for Set_Cursor_Pos()

    Hi all, im a newbie to VBA and the site but hoping you can help me!

    I am aware of the Set_Cursor_Pos() command but what I am trying to do (and failing so far!) is to force the cursor to the last non blank cell in column C of a worksheet on the press of of a button. I can make the button and know how to attach the code, its just the code i cant fathom!

    can it be done please?

    Cheers

    Simon

  2. #2
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    [VBA]
    Private Sub Commandbutton1_click()
    application.goto sheets("sheet1").cells(rows.count,3).end(xlup)
    end sub
    [/VBA]

  3. #3
    VBAX Newbie
    Joined
    Oct 2012
    Posts
    4
    Location
    thank you so much snb ! works a treat !

    If you have time it would be cool to understand how and why this works to help my fill my knowledge gap!

  4. #4
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    I think the best explanation you will find in the VBEditor's helpfiles. lemmata:
    - goto
    - cells()
    - end()

Posting Permissions

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