+ Reply to Thread
Results 1 to 5 of 5

Select all except last row

  1. #1
    Registered User
    Join Date
    08-14-2017
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    48

    Select all except last row

    Hey everyone,

    Probably a stupid question, but can't seem to find the right solution for it on the internet.

    I want to select a range, except the last row. I tried it with "offset", but the result is that he moves the selection 1 Up, and that is not what I want. I want to keep the selection, minus the last selected row.

    Code I use now is
    Please Login or Register  to view this content.
    Thx for the help!

  2. #2
    Registered User
    Join Date
    10-12-2017
    Location
    Brazil
    MS-Off Ver
    2016
    Posts
    59

    Re: Select all except last row

    Helo.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-14-2017
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    48

    Re: Select all except last row

    Thanks for the quick reply, but its a bit more complex (yeah, I should mention it the first time.

    I attached what I would like to select (purple) and copy to another file. The starting point of the selection is always the same., but the number of lines can be different. It always ends with the grand total line, but that is the one I don't want to copy...

    Thanks!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-12-2017
    Location
    Brazil
    MS-Off Ver
    2016
    Posts
    59

    Re: Select all except last row

    Hello
    Will you copy each of the purple regions to a new worksheet?
    Each of the regions for a different worksheet? All for the same spreadsheet but discarding the "grand total" line?
    Explain this copy routine, please.

  5. #5
    Registered User
    Join Date
    08-14-2017
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    48

    Re: Select all except last row

    Hello,

    - Yes, each purple area should be copied to a other worksheet, where the paste location is fixed. Let say for the first store, they have to paste the values starting in A7, for the second store, paste it in the same workbook/sheet starting in call A2, and so on...
    - Answer on your second question, All purple area's should be copied, indeed WITHOUT the grand total line (that's why I tried the offset -1 first) and ALL to 1predefined (so no new, there is a template already) excel.

    Open Book1.xlsm
    Copy the first purple area
    Open Template.xlsx
    Paste values in A7
    Back to Book1.clsm
    Copy second purple area
    Back tot Template.xlsx
    Paste values in A27
    ....

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 11
    Last Post: 11-03-2017, 05:11 AM
  2. Replies: 1
    Last Post: 08-18-2016, 03:17 AM
  3. [SOLVED] Select last row in column A and select 49 rows up, copy results to A2
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2016, 02:59 PM
  4. Newbie: Auto Select/un-Select an Range of Slicer Items
    By luckyali in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2014, 09:52 AM
  5. [SOLVED] Modify existing code to select file instead of select folder
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2014, 09:41 AM
  6. Replies: 4
    Last Post: 06-17-2013, 05:21 AM
  7. Code to prevent user to Select COLUMNS but allow to select ROWS
    By tengrosita in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-05-2011, 03:46 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