+ Reply to Thread
Results 1 to 4 of 4

Selecting a range of cells using ActiveCell where the start point is variable

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Selecting a range of cells using ActiveCell where the start point is variable

    Hi All

    I'm trying to develop a code that selects a range of cells, copy's and pastes them to another sheet. The problem is that the second set of data is on the same sheet as the first set I can identify where the data starts as the table has "Service" in cell A* with * being a variable as the starting point changes week to week. so in today's book its A180 but next week it could be A150 etc. The bit i'm having problem with is i need to copy from the table the range A* to J* to the end of the table so i've put together the following but i'm struggling with the "Range(ActiveCell, ActiveCell.End(xlToRight)).Select" as its only going to "D*". I've tried recording macros to select the range to J but it just keeps returning the value I've selected. I.E. "Range("A180:J180").Select".

    Please Login or Register  to view this content.
    Can anyone offer any assistance

    Kind Regards

    John
    Last edited by jshaw82; 05-12-2013 at 05:03 AM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Selecting a range of cells using ActiveCell where the start point is variable

    Hi, John,

    maybe like this:
    Please Login or Register  to view this content.
    If you want the range to go to Column J
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Last edited by HaHoBe; 05-12-2013 at 05:20 AM.
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Re: Selecting a range of cells using ActiveCell where the start point is variable

    Hi Holger, Thanks for your response.

    I've tried to implement your code but its selecting the wrong data.

    I've attached an example workbook for you to see the layout of the data set i'm working with.

    The first part of the macro copy's the data under "install" in cols A to J where it ends and the second part is where i'm trying to get it to copy in this example A43:J83 where "service" starts to the end of that table. When I run your code it selects A to J from row 1 and stops at the word "service". I appreciate your help Holger.

    rngSelect.xls

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Selecting a range of cells using ActiveCell where the start point is variable

    Hi, John,

    thatīs what the code is supposed to do (thatīs what I understood from the post).

    Regarding the area to copy:
    Please Login or Register  to view this content.
    Ciao,
    Holger

+ 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