+ Reply to Thread
Results 1 to 15 of 15

Delete multiple columns in a Table

Hybrid View

  1. #1
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Excel VBA Areas Collection Object Thingy :)

    As Rory said, in Excel, an Area is a contiguous range of cells . This can be "got at" in VBA throught the Areas Collection Object.

    A Range Object is more often than not a contiguous range of cells ( so that is a typical VBA guess as its "Implicit default" thingy ** ). But it does not have to be. It is not defined as such; A Range Object can be a non contiguous range of cells:

    A Range Object is a group of cells in a worksheet. The list of the cells of the range is organised in rectangular groups of cells, each one named an Area. ( Can be reffered to by its Item Number, counting, I believe in the order they were added )

    I believe when you do something like this ( Where rng is a Range Object )

    ______rng._____ =

    Then that Implicitly defaults to the first Area**

    ______rng. Areas.Item(1).______ =
    _ .. try it .. just add that bit in any code you have, - it does no harm ( well might **** some people off )

    You can build up the Areas using the Union Method

    Somethings will not "appear" to "work" for you on a Range built with the Union. Or they may only appear to "work" on the first Area you added. That is usually because the code line you write defaults to the first Area, so just applies to that first Area.
    I think you usually need to loop through to apply things to all Areas. For example this sort of thing
    ___For Each rgCell In rgUnion
    ___ _........_...
    ___ _...
    ___Next
    is the quickest I believe.

    But I think some things will work in "one go" on the Unioned Range Object, as an example:

    rgUnion.Interior.Color = vbRed



    Rem Ref
    http://www.eileenslounge.com/viewtop...181736#p181655

    Post #27 http://www.mrexcel.com/forum/excel-q...-column-3.html




    Bill Gelatine
    Last edited by Doc.AElstein; 05-28-2016 at 08:05 AM.
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

+ 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. [SOLVED] VBA Delete Row If Ciriteria From Multiple Columns are Met
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2014, 02:07 AM
  2. Add and Delete table columns without cells shifting?
    By brucemc777 in forum Excel General
    Replies: 3
    Last Post: 05-19-2014, 05:50 PM
  3. [SOLVED] Convert table with multiple header columns into a pivotable table
    By jasonleewkd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2013, 03:20 AM
  4. Replies: 9
    Last Post: 12-20-2012, 10:29 AM
  5. [SOLVED] Delete multiple empty cells in multiple columns and moving data up, witout Macros
    By CoraF in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-30-2012, 08:23 AM
  6. Delete multiple columns by column name no criteria need, just delete them
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2009, 10:40 AM
  7. Delete multiple columns if they fit different criteria
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 06-23-2009, 02:36 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