+ Reply to Thread
Results 1 to 4 of 4

select cell

  1. #1
    Anna
    Guest

    select cell

    My objective is : select a range of cells from A1 to {cell}. {cell} is a
    variable that my cursor stays.
    For example, if my cursor stop at cell h13, the macro will select a1..h13.
    If my cursor stop at cell h26, the macro will select a1..h26.

    Is it possible to have this kind of coding?

    Range("A1:{cell}").Select
    How can I substitute the selected cell's name into {cell}?
    Please advise


  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    Sub Macro1()
    '
    ' Macro1 Macro
    ' Macro recorded 3/14/2006 by Dave
    '

    '
    Range("A1:H13").Select
    End Sub

    or

    Sub Macro2()
    '
    ' Macro2 Macro
    ' Macro recorded 3/14/2006 by Dave
    '

    Range("A1").Select

    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
    End Sub


    this starts at A1 and Ends at your last cell

  3. #3
    Gary Keramidas
    Guest

    Re: select cell

    do you mean the activecell, the cell the cursor is in?

    Range("A1:" & ActiveCell.Address).Select

    --


    Gary


    "Anna" <[email protected]> wrote in message
    news:[email protected]...
    > My objective is : select a range of cells from A1 to {cell}. {cell} is a
    > variable that my cursor stays.
    > For example, if my cursor stop at cell h13, the macro will select a1..h13.
    > If my cursor stop at cell h26, the macro will select a1..h26.
    >
    > Is it possible to have this kind of coding?
    >
    > Range("A1:{cell}").Select
    > How can I substitute the selected cell's name into {cell}?
    > Please advise
    >




  4. #4
    Tom Ogilvy
    Guest

    Re: select cell

    Range("A1",ActiveCell).Select

    --
    Regards,
    Tom Ogilvy



    "Anna" <[email protected]> wrote in message
    news:[email protected]...
    > My objective is : select a range of cells from A1 to {cell}. {cell} is a
    > variable that my cursor stays.
    > For example, if my cursor stop at cell h13, the macro will select a1..h13.
    > If my cursor stop at cell h26, the macro will select a1..h26.
    >
    > Is it possible to have this kind of coding?
    >
    > Range("A1:{cell}").Select
    > How can I substitute the selected cell's name into {cell}?
    > Please advise
    >




+ 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