Results 1 to 5 of 5

Thread: [RESOLVED] vba excel question

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    10

    Resolved [RESOLVED] vba excel question

    Hi, I'm a vba neophyte messing around within a macro, that I did not write, and trying to discern the effect of the following code:

    ActiveCell.Offset(1, 0).Range("A1").Select


    I understand that

    ActiveCell.Offset(1, 0).Select

    selects the cell one row below the original active cell, but i'm unclear as to the impact of adding '.Range("A1").Select.' between the offset and select properties. I've run each piece separately with a command button and they appear to do the same thing, namely move the cell highlight down a row.

    What am I missing? Also, why would we want to alter range properties when only selecting a single cell?

  2. #2
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: vba excel question

    Welcome to VBForums

    That line should the same as
    Code:
    ActiveCell.Offset(1, 0).Select
    in other words the "Range("A1") in there does nothing!
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    10

    Re: vba excel question

    Thanks so much. Any idea why it was placed in there?

  4. #4
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: vba excel question

    No telling, at least not without knowing the context from which you got that.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    10

    Re: [RESOLVED] vba excel question

    thanks. i don't think it was an attempt to do anything too special. i'll have to ask and see his intentions

Posting Permissions

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



Click Here to Expand Forum to Full Width