Results 1 to 4 of 4

Help with Non Contiguous Row Ranges

Threaded View

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    Londonish, England
    MS-Off Ver
    Excel 2010
    Posts
    58

    Help with Non Contiguous Row Ranges

    Hi All,

    I've got the following code in use:

    BookLastrow = Range("A3").End(xlDown).Row
    DVDLastrow = Range("A739").End(xlDown).Row
    
    'More Code yadayadayada
    
    Set ALLISBN = Range("A3:A & BookLastrow, A739:A & DVDLastrow")
    However I am getting a run time error 1004. Basically to cut a long story short I'm trying to future proof the macro so when people insert rows into the workbook the macro will handle it without me hard coding the different absolute references.

    The absolute cell references as they are at the current time are:

    Set ALL ISBN Range("A3:A736, A739:A1023")
    I can get

    Set ALLISBN = Range("A3:A & BookLastrow, A739:A & DVDLastrow")
    to work only if I add speech marks to for example:

    ("A3:A" & Booklastrow, "A739:A" & DVDLastrow)
    However the above also gives the cells inbetween e.g. A736 to A739 when I run the code through (which is not what I want). It's hopefully just a syntax thing if anyone can help?

    Thanks

    Chriz
    Last edited by Chriz; 07-25-2013 at 06:27 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Contiguous "Range" from Non Contiguous Ranges
    By DonkeyOte in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-03-2011, 03:23 PM
  2. Copy and Paste an array (contiguous & non contiguous ranges)
    By Xrull in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-09-2010, 09:17 AM
  3. Sorting Non Contiguous Ranges
    By tekman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2009, 04:58 PM
  4. [SOLVED] vlookup on non-contiguous ranges
    By BorisS in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-15-2006, 05:35 AM
  5. sorting non contiguous ranges
    By gsh20 in forum Excel General
    Replies: 1
    Last Post: 09-08-2005, 12:05 PM

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