+ Reply to Thread
Results 1 to 5 of 5

Shift and Arrow Key Code

  1. #1
    Registered User
    Join Date
    06-28-2005
    Posts
    5

    Shift and Arrow Key Code

    If Excel Macro Codes for Arrow Keys on KeyBoard is:

    Selection.Offset(0, 1).Select '*Right*
    Selection.Offset(0, -1).Select '*Left*
    Selection.Offset(-1, 0).Select '*Up*
    Selection.Offset(1, 0).Select '*Down*

    Selection.Offset(0, 2).Select '*Right*
    is 2 Cells Right respectively.
    ------------------------------------

    What is the code for Shift and Arrow Key ?


    I need to Select more than 1 Cell and then Copy that group of Cells.

    Thanks in Advance.

  2. #2
    Chip Pearson
    Guest

    Re: Shift and Arrow Key Code

    Try

    ActiveCell.Resize(num_rows,num_columns).Select


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "strung" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > If Excel Macro Codes for Arrow Keys on KeyBoard is:
    >
    > Selection.Offset(0, 1).Select '*Right*
    > Selection.Offset(0, -1).Select '*Left*
    > Selection.Offset(-1, 0).Select '*Up*
    > Selection.Offset(1, 0).Select '*Down*
    >
    > Selection.Offset(0, 2).Select '*Right*
    > is 2 Cells Right respectively.
    > ------------------------------------
    >
    > What is the code for Shift and Arrow Key ?
    >
    >
    > I need to Select more than 1 Cell and then Copy that group of
    > Cells.
    >
    > Thanks in Advance.
    >
    >
    > --
    > strung
    > ------------------------------------------------------------------------
    > strung's Profile:
    > http://www.excelforum.com/member.php...o&userid=24731
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=479980
    >




  3. #3
    bpeltzer
    Guest

    RE: Shift and Arrow Key Code

    Range(Selection, Selection.Offset(0, 1)).Select 'shift-right.


    "strung" wrote:

    >
    > If Excel Macro Codes for Arrow Keys on KeyBoard is:
    >
    > Selection.Offset(0, 1).Select '*Right*
    > Selection.Offset(0, -1).Select '*Left*
    > Selection.Offset(-1, 0).Select '*Up*
    > Selection.Offset(1, 0).Select '*Down*
    >
    > Selection.Offset(0, 2).Select '*Right*
    > is 2 Cells Right respectively.
    > ------------------------------------
    >
    > What is the code for Shift and Arrow Key ?
    >
    >
    > I need to Select more than 1 Cell and then Copy that group of Cells.
    >
    > Thanks in Advance.
    >
    >
    > --
    > strung
    > ------------------------------------------------------------------------
    > strung's Profile: http://www.excelforum.com/member.php...o&userid=24731
    > View this thread: http://www.excelforum.com/showthread...hreadid=479980
    >
    >


  4. #4
    Registered User
    Join Date
    06-28-2005
    Posts
    5
    Chip Pearson Try
    ActiveCell.Resize(num_rows,num_columns).Select
    I don't understand where I can put the 33 cells I need to copy
    ------------------------------------------------------------------------------>
    bpeltzer
    Range(Selection, Selection.Offset(0, 1)).Select 'shift-right.
    The line of code goes to Red and won't work.
    ------------------------------------------------------------------------------>
    The issue is this,
    The macro does a Find for a particular word in the worksheet.
    That particular word (Text) is the title of what the contents are in each of the 33 cells below it.
    But it (Title) does not always start in the same cell, so I can't use the Cell Range code constantly.


    Once I Find the Title, then I would normaly do a Shift _Arrow-Key_Down and then copy the entire contents of those 33 Cells, manually.
    That's why I cannot use a Cell Range code.

    So it's basicaly: Macro finds the Title,
    Then: Selection.Offset(1, 0).Select '*Down*
    Then: Select the entire cell range below the title to Copy
    I can make it do everything except select the entire range of upto 33 Cells below Title.


    Example.
    Title
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    Hope this makes sense

  5. #5
    Chip Pearson
    Guest

    Re: Shift and Arrow Key Code

    Try

    Range(ActiveCell, ActiveCell.End(xlDown)).Select


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com




    "strung" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    >> Chip Pearson Try
    >> ActiveCell.Resize(num_rows,num_columns).Select

    > I don't understand where I can put the 33 cells I need to copy
    > ------------------------------------------------------------------------------>
    >> bpeltzer
    >> Range(Selection, Selection.Offset(0, 1)).Select 'shift-right.

    > The line of code goes to Red and won't work.
    > ------------------------------------------------------------------------------>
    > The issue is this,
    > The macro does a Find for a particular word in the worksheet.
    > That particular word (Text) is the title of what the contents
    > are in
    > each of the 33 cells below it.
    > But it (Title) does not always start in the same cell, so I
    > can't use
    > the Cell Range code constantly.
    >
    >
    > Once I Find the Title, then I would normaly do a Shift
    > _Arrow-Key_Down
    > and then copy the entire contents of those 33 Cells, manually.
    > That's why I cannot use a Cell Range code.
    >
    > So it's basicaly: Macro finds the Title,
    > Then: Selection.Offset(1, 0).Select '*Down*
    > Then: Select the entire cell range below the title to Copy
    > I can make it do everything except select the entire range of
    > upto 33
    > Cells below Title.
    >
    >
    > Example.
    > Title
    > 1
    > 2
    > 3
    > 4
    > 5
    > 6
    > 7
    > 8
    > 9
    > 10
    > 11
    > 12
    > 13
    > 14
    >
    > Hope this makes sense
    >
    >
    > --
    > strung
    > ------------------------------------------------------------------------
    > strung's Profile:
    > http://www.excelforum.com/member.php...o&userid=24731
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=479980
    >




+ 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