+ Reply to Thread
Results 1 to 5 of 5

Insert rectangular autoshape using vba based on different cell value

  1. #1
    Registered User
    Join Date
    03-27-2009
    Location
    Surat,India
    MS-Off Ver
    Excel 2007
    Posts
    52

    Insert rectangular autoshape using vba based on different cell value

    Hi, All

    I want to create rectangular bar for my activity based start date and finish date (I don't want to use conditional formatting). What I want is macro will check start date and based on that it will create rectangle to start on that cell and width will be up to end date of any activity.

    At present I m not able to attach example file. I will attach as soon as I can.

    Regards,

    Vishnu
    Last edited by hifliers; 04-11-2014 at 03:00 AM. Reason: Solved

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Insert rectangular autoshape using vba based on different cell value

    In which cells are the dates stored ?

    In which cells is the rectangle to be drawn ?
    Gary's Student

  3. #3
    Registered User
    Join Date
    03-27-2009
    Location
    Surat,India
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Insert rectangular autoshape using vba based on different cell value

    # A B C D E F G H I J K L M N O
    1 Start End 1/1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 1/9 1/10 1/11 1/11 1/12
    2 1/5 1/10

    Please check above start cell is A2 and End Cell is B2
    Now macro will check start date and based on that it will rectangle some where between C2 to O2.
    In this example it will be G2 to L2.

    Again sorry for inconvenience as I am not able to attaché file now.

    Regards,

    Vishnu
    Attached Files Attached Files
    Last edited by hifliers; 04-08-2014 at 09:46 AM. Reason: Attachment added

  4. #4
    Registered User
    Join Date
    03-27-2009
    Location
    Surat,India
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Insert rectangular autoshape using vba based on different cell value

    Gurus,
    Please suggest any idea...

  5. #5
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: Insert rectangular autoshape using vba based on different cell value

    This should get you started.

    Things to consider -
    This is based on columns being 1 day intervals, 1 day after the another

    a sheet event will fire on entry of data to cell in columns B or C.
    Or you can delete all or reset all

    Sheet code module
    Please Login or Register  to view this content.


    standard code module
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-27-2009
    Location
    Surat,India
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Insert rectangular autoshape using vba based on different cell value

    Great!! Wotadude!!

    Something which is beyond my imagination! You did a great job.
    Now based on this I will start preparing my final sheet. I will post my final sheet for your feedback.If any problem in between I post it in a new thread.

    Thank you again!!
    With best regards,
    Vishnu

+ 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. Change autoshape color based on a cell value that contains a formula
    By Myexceltuts in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-09-2014, 10:25 AM
  2. Alter cell appearence to a non-rectangular shape
    By faraway in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-13-2013, 09:17 AM
  3. How to use a conditional function to insert an autoshape?
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 12:05 PM
  4. [SOLVED] How to use a conditional function to insert an autoshape?
    By ToledoMichael in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. [SOLVED] How to use a conditional function to insert an autoshape?
    By ToledoMichael in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-07-2005, 10:05 AM

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