Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default One-line bar chart for %

Thank you all,

It looks like it should work fine!

Jef

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Line Chart - Chart line to go directly to next value TyreDude Charts and Charting in Excel 3 October 12th 11 12:52 PM
change line formatting in line chart - Excel 2007 LisaK Charts and Charting in Excel 1 August 27th 09 11:09 AM
How do I convert a line chart to a vertical line chart in Excel Gerty Charts and Charting in Excel 1 August 20th 09 04:28 PM
change last serie to be line in the line-column Excel chart in Wor Eric Charts and Charting in Excel 3 June 30th 07 04:58 PM
Make a line in a bar chart, and change color of any bars that exceed the line MarkM Excel Discussion (Misc queries) 4 July 5th 06 04:06 PM


All times are GMT +1. The time now is 06:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"