Results 1 to 3 of 3

selecting range from Activecell to last entry in the same row as active cell

Threaded View

  1. #1
    Registered User
    Join Date
    07-01-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2007
    Posts
    37

    selecting range from Activecell to last entry in the same row as active cell

    Hi Everyone,

    I'm hoping someone can help me correct my code. I have got stuck on one piece of my code and having trouble fixing... Overall I am trying to find variable station name in cell L2 of Sheet 2 in Sheet 1 and then select and copy the data from the data in "cell L2 of Sheet 2" to the last entry of that row. I have attached an example test spreadsheet of the data and a macro is within Sheet 1 called test1. Please note that cell L2 in Sheet 2 will always be different station name and the station list in Sheet 1 will change with differing station name.

    The code I am using is:

    Sheets("Sheet1").Select
    ActiveSheet.Range("A1").Select
    Dim rngFnd As Range
    Set rngFnd = Worksheets("Sheet1").Range("a:A").Find(What:=Sheets("Sheet2").Range("L2").Value, LookIn:=xlFormulas, _
    rngFnd.Activate
    ActiveCell.Select
    ActiveSheet.Range("ActiveCell").Select.Range(Selection, Selection.End(xlToRight)).Select
    Selection.Copy
    The code that is not working and bringing up an error is:

    ActiveSheet.Range("ActiveCell").Select.Range(Selection, Selection.End(xlToRight)).Select
    Any help would be greatly appreciated. Thanks so much.

    Cheers,
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Selecting Activecell and cell next to the Activecell
    By Raghukumarn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-31-2013, 06:32 AM
  2. Selecting Range from Active Cell to Last Row with data in same column
    By bs04do in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2013, 10:59 AM
  3. [SOLVED] How to select cell to the right of active cell without selecting the activecell aswell?
    By Emmaly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2012, 07:22 AM
  4. Selecting Range next to ActiveCell
    By ChrisF79 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-07-2008, 02:28 PM
  5. Replies: 1
    Last Post: 07-31-2006, 07:33 AM

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