+ Reply to Thread
Results 1 to 2 of 2

VB script for conditional merging & filling of some cells in a row

  1. #1
    Registered User
    Join Date
    10-26-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    VB script for conditional merging & filling of some cells in a row

    Hi,

    Need help for a VB code that does the following :
    ( Sample excel sheet is also attached that explains the requirement clearly
    before & after running the script)

    1. It should work on those "rows" in which :
    Cell A contains a string
    Cell B contains a number
    Cell C contains a number
    Cell D contains a "number" or string "None"

    2. Once it identifies the rows, then :

    If cell D contains "None", then it should
    - Merge all cells in the row from "number in B + 4" to "number in C + 4"
    - Add borders
    - Fill with some colour.

    If cell D contains a number, then :
    - Merge all cells in the row from "number in B + 4" to "number in D + 4" and
    - Merge all cells in the row from "number in D + 4 +1" to "number in C + 4"
    - Add borders & fill both the merged cells with some colour.
    - Add a comment in the first cell as "Trial o/p available"

    Thanks for any help in advance.
    Attached Files Attached Files
    Last edited by rprasad68; 10-26-2009 at 09:35 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: New guy for VB : Need help for conditional merging & filling of some cells in a r

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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