+ Reply to Thread
Results 1 to 6 of 6

Conditional Merge VBA

  1. #1
    Forum Contributor
    Join Date
    04-18-2006
    Posts
    135

    Conditional Merge VBA

    Hi,

    I am trying to write a VBA for merging cells if Column A contains text and the next 2 columns are blank then select that row from column A to column H and merge but am having problems with selecting the correct range have highlighted my error in red.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    The argument of the one argument form of Range must be a string
    Please Login or Register  to view this content.
    . Here are a couple of of other options
    Please Login or Register  to view this content.
    I also avoid selection altogether, it slows things down and brings extranious factors (like which sheet is active) into everything.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-18-2006
    Posts
    135
    Thank you works perfectly now

  4. #4
    Forum Contributor
    Join Date
    04-18-2006
    Posts
    135
    Sorry need a bit more help

    now i'm trying to format the cells that are being merged. I can make the font arial, white and bold. But I dont know how to add in the two formatting styles below.

    Please Login or Register  to view this content.


    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Try this:
    Please Login or Register  to view this content.
    HTH

    Jason

  6. #6
    Forum Contributor
    Join Date
    04-18-2006
    Posts
    135
    Thank you, just that i didnt explain myself well I wanted the Cell color to be green not the font...but thanks to you I figured out how to do it...much appreciated.


    Please Login or Register  to view this content.

+ 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