Consulting

Results 1 to 4 of 4

Thread: Ofsetting Cell by 1, 0 vba

  1. #1

    Ofsetting Cell by 1, 0 vba

    hi, i have this code but every time it says compile error, could you please help many thanks

     Range("A25").Select
        Selection.End(xlUp).Select
        selection.Offset(1, 0)

  2. #2
    VBAX Mentor
    Joined
    Feb 2015
    Posts
    395
    Location
    'Using your code
        Range("A25 ").Select
        Selection.End(xlUp).Select
        Selection.Offset(1, 0).Select
    
    'Same but neater
        Range("A25 ").Select
        Selection.End(xlUp).Offset(1,0).Select
           
    'I use message boxes frequently as I build unfamiliar code
    'This might be overkill here but shows exactly where cursor is going etc
    'Message boxes can tell you a huge amount
        Range("A25 ").Select
        MsgBox "1 Now at " & ActiveCell.Address
        Selection.End(xlUp).Select
        MsgBox "2 Now at " & ActiveCell.Address
        Selection.Offset(1, 0).Select
        MsgBox "3 Now at " & ActiveCell.Address

  3. #3
    Thanks so much Yongle it was really helpful

  4. #4
    Re: Same but neater????
    Range("A25").End(xlUp).Offset(1).Select
    Selecting however should not be required but we need to see the rest of the code.

Posting Permissions

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