+ Reply to Thread
Results 1 to 6 of 6

Not getting how to write a Union Range

  1. #1
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Not getting how to write a Union Range

    I am trying to use Union for the first time and I guess I am not getting it as the Macros fires but nothing happens

    Please Login or Register  to view this content.
    Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Not getting how to write a Union Range

    Have you tried stepping through the code in debug manner? This will allow you to see each step and determine where the code is failing.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Not getting how to write a Union Range

    Hi there,
    it looks like the start of IF is missing... Can You check that?
    Regards
    Miroslav R.

    (If You like my solutions, feel free to add reputation.)

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Not getting how to write a Union Range

    Sorry ignore me :o)
    Last edited by nathansav; 05-22-2014 at 09:34 AM.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  5. #5
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Not getting how to write a Union Range

    I had two things wrong and neither was the Union

    LR = Range("A" & Rows.Count).End(xlUp).Row to get the last row of the visible range

    This LR = Range("A" & Rows.Count).SpecialCells(xlCellTypeVisible).End(xlUp).Row only evaluates to 1?

    And yes I was missing the beginning of my if which is a UDF

    Now all is working fine

    Thank yon all for the help

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Not getting how to write a Union Range

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Union Range Problem
    By LDwoods in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2014, 09:45 PM
  2. [SOLVED] Range/union
    By Dibbley247 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2013, 10:35 AM
  3. Formula in Range Union!!
    By blueangel2005 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2008, 06:35 AM
  4. union range problem
    By Walter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2006, 07:35 PM
  5. [SOLVED] Union/Range/Cells
    By KentÄ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2005, 08:06 AM

Tags for this Thread

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