+ Reply to Thread
Results 1 to 1 of 1

Databar based on another cell value using VBA/ Macro

  1. #1
    Registered User
    Join Date
    04-06-2012
    Location
    India
    MS-Off Ver
    Pro Plus 2019
    Posts
    86

    Databar based on another cell value using VBA/ Macro

    Hi!

    As per Standard Excel the length of databar is equal to the value in the cell where the databar is displayed (subject to upper and lower limits specified in other cells).
    Following macro allows me to create a Databar using min. and max range between cells A3 to A4, and the databar is displayed in cells A2 to A4.

    Please Login or Register  to view this content.
    I was wondering whether it could be possible to modify the macro to display the databar in Cell A1, with the databar length corresponding to value in cell A2 and min/ max range being held in cells A3 to A4.

    For example, if the Value in cell A2 is 300, and range in cells A3-A4 is 1-900, the length of databar being displayed in cell A1 should correspond to 300, even though the value in cell A1 is 600. (Perhaps the databar could read the cell value from a range in the macro itself and display the databar in the worksheet)

    Capture.PNG

    Also, the databars are currently being displayed in cell A2 to A4. I believe this is because I have not defined rg As Range properly. Can someone please help to let the databar appear only in cell A2.

    Sample file attached.
    Attached Files Attached Files
    Last edited by naira; 01-21-2019 at 07:36 AM.

+ 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. Conditional Formatting - Databar not displaying
    By DarkEgon in forum Excel General
    Replies: 1
    Last Post: 10-05-2016, 01:38 PM
  2. Databar macro based on dates
    By Kyle9999 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-13-2015, 08:58 AM
  3. Macro to change colour of cell based on finding a specific word in the cell
    By Shelby761 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2014, 09:46 AM
  4. Create Auto-Calculating Cell and Assign Cell Values Based on a Macro
    By Titanium Fox in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-26-2013, 12:00 AM
  5. Replies: 4
    Last Post: 09-15-2012, 02:46 PM
  6. Macro that will clear contents of cell based on format of text in adjacent cell
    By judasdac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-12-2012, 01:56 AM
  7. Macro to auto populate the destination cell based on the values of the previous cell
    By Avinash Kumar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-05-2009, 02:06 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