Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
One-line bar chart for %
Hello all,
I have a list of percentages that I hope can be represented by a singl horizontal bar chart. Each bar would represent the percentage in th cell to its left. No comparisons or multibar are needed, just a one line bar that fit the next cell horizontally, like so: 56% Chart 78% Chart 61% Chart and so on... The chart will be the same size for all entries. If anyone can help or has any pointers, some direction would be greatl appreciated. Jef -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
One-line bar chart for %
Jeff,
You want something to the right of these cells that graphically shows (chart-style, horizontally) the value in each cell? I don't know if I've interpreted your question correctly. Try this: =REPT("-",A2*100) Copy down. -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- "Kilcup " wrote in message ... Hello all, I have a list of percentages that I hope can be represented by a single horizontal bar chart. Each bar would represent the percentage in the cell to its left. No comparisons or multibar are needed, just a one line bar that fits the next cell horizontally, like so: 56% Chart 78% Chart 61% Chart and so on... The chart will be the same size for all entries. If anyone can help or has any pointers, some direction would be greatly appreciated. Jeff --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
One-line bar chart for %
Thanks for the help with this, it gets the idea across, which is what
need. I still seem to have some issues formulating the same thin within vba, though. This is what I have thus far: Set rng = Cells(Rows.Count, 1).End(xlUp) Worksheets("_DeputationQuery").Range("F1").Activat e For i = 1 To rng.Row ActiveCell.Formula = "=REPT(""|"",E" & i & "*100)" ActiveCell.Offset(1, 0).Select Next i The error I receive is from the "ActiveCell.Formula" line. If you ca help me finish this off, a director at my office will definitel appreciate it! Jef -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
One-line bar chart for %
Your code worked ok for me, but another way to do this is to populate the whole
range in one fell swoop. Just like selecting a range, typing the formula (for the activecell) and hitting ctrl-enter to fill the other cells in the selection. Dim lastRow As Long With Worksheets("_DeputationQuery") lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("f1:f" & lastRow).Formula = "=REPT(""|"",E1*100)" End With "Kilcup <" wrote: Thanks for the help with this, it gets the idea across, which is what I need. I still seem to have some issues formulating the same thing within vba, though. This is what I have thus far: Set rng = Cells(Rows.Count, 1).End(xlUp) Worksheets("_DeputationQuery").Range("F1").Activat e For i = 1 To rng.Row ActiveCell.Formula = "=REPT(""|"",E" & i & "*100)" ActiveCell.Offset(1, 0).Select Next i The error I receive is from the "ActiveCell.Formula" line. If you can help me finish this off, a director at my office will definitely appreciate it! Jeff --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
One-line bar chart for %
Thank you all,
It looks like it should work fine! Jef -- Message posted from http://www.ExcelForum.com |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
One-line bar chart for %
Try this manually against a cell with a percentage in it (test worksheet):
=REPT(REPT(CHAR(134),4)&" ",INT(A1*100/5))&REPT("|",MOD(A1*100,5)) If you like that effect: In your code: ..Range("f1:f" & lastRow).Formula _ = "=REPT(REPT(CHAR(134),4)&"" "",INT(E1*100/5))&REPT(""|"",MOD(E1*100,5))" "Kilcup <" wrote: Thank you all, It looks like it should work fine! Jeff --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 Line Chart - Chart line to go directly to next value | Charts and Charting in Excel | |||
change line formatting in line chart - Excel 2007 | Charts and Charting in Excel | |||
How do I convert a line chart to a vertical line chart in Excel | Charts and Charting in Excel | |||
change last serie to be line in the line-column Excel chart in Wor | Charts and Charting in Excel | |||
Make a line in a bar chart, and change color of any bars that exceed the line | Excel Discussion (Misc queries) |