Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default TopLeftCell change to "bottom"LeftCell

Hello,
I've got a macro (thanks to users here) that inserts a rectangle that fills
a cell proportionally based on the contents of the cell. I would like to
modify it so that the shape starts from the bottom and fills (top to bottom)
proportionally. Here's the macro as it is now:

Sub Proportionally_Fill()

Dim c As Range
Dim v As Single
Dim s As Shape

For Each c In Selection
If c.Value = 0 And c.Value <= 1 Then

v = c.Value
Set s = ActiveSheet.Shapes.AddShape(msoShapeRectangle, _
c.Left, c.Top, c.Width * v, c.Height)
s.Fill.Visible = msoTrue
s.Fill.ForeColor.SchemeColor = 17
s.Line.Visible = msoFalse
Selection.Font.ColorIndex = 2
End If
Next c
End Sub

I can get the overall shape centered, but haven't a clue how to get the
shape to start at the bottom.

Thanks in advance,
MJohn
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default TopLeftCell change to "bottom"LeftCell

Sub Proportionally_Fill()

Dim c As Range
Dim v As Single
Dim s As Shape
Dim x

For Each c In Selection
If c.Value = 0 And c.Value <= 1 Then

v = c.Value
x = v * c.Height
Set s = ActiveSheet.Shapes.AddShape(msoShapeRectangle, _
c.Left, (c.Top + c.Height) - x, c.Width, x)
s.Fill.Visible = msoTrue
s.Fill.ForeColor.SchemeColor = 17
s.Line.Visible = msoFalse
Selection.Font.ColorIndex = 2
End If
Next c
End Sub



--
Tim Williams
Palo Alto, CA


"M John" wrote in message ...
Hello,
I've got a macro (thanks to users here) that inserts a rectangle that fills
a cell proportionally based on the contents of the cell. I would like to
modify it so that the shape starts from the bottom and fills (top to bottom)
proportionally. Here's the macro as it is now:

Sub Proportionally_Fill()

Dim c As Range
Dim v As Single
Dim s As Shape

For Each c In Selection
If c.Value = 0 And c.Value <= 1 Then

v = c.Value
Set s = ActiveSheet.Shapes.AddShape(msoShapeRectangle, _
c.Left, c.Top, c.Width * v, c.Height)
s.Fill.Visible = msoTrue
s.Fill.ForeColor.SchemeColor = 17
s.Line.Visible = msoFalse
Selection.Font.ColorIndex = 2
End If
Next c
End Sub

I can get the overall shape centered, but haven't a clue how to get the
shape to start at the bottom.

Thanks in advance,
MJohn



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default TopLeftCell change to "bottom"LeftCell

Thanks again. You've been a star.

Most appreciated.

MJohn

"Tim Williams" wrote:

Sub Proportionally_Fill()

Dim c As Range
Dim v As Single
Dim s As Shape
Dim x

For Each c In Selection
If c.Value = 0 And c.Value <= 1 Then

v = c.Value
x = v * c.Height
Set s = ActiveSheet.Shapes.AddShape(msoShapeRectangle, _
c.Left, (c.Top + c.Height) - x, c.Width, x)
s.Fill.Visible = msoTrue
s.Fill.ForeColor.SchemeColor = 17
s.Line.Visible = msoFalse
Selection.Font.ColorIndex = 2
End If
Next c
End Sub



--
Tim Williams
Palo Alto, CA


"M John" wrote in message ...
Hello,
I've got a macro (thanks to users here) that inserts a rectangle that fills
a cell proportionally based on the contents of the cell. I would like to
modify it so that the shape starts from the bottom and fills (top to bottom)
proportionally. Here's the macro as it is now:

Sub Proportionally_Fill()

Dim c As Range
Dim v As Single
Dim s As Shape

For Each c In Selection
If c.Value = 0 And c.Value <= 1 Then

v = c.Value
Set s = ActiveSheet.Shapes.AddShape(msoShapeRectangle, _
c.Left, c.Top, c.Width * v, c.Height)
s.Fill.Visible = msoTrue
s.Fill.ForeColor.SchemeColor = 17
s.Line.Visible = msoFalse
Selection.Font.ColorIndex = 2
End If
Next c
End Sub

I can get the overall shape centered, but haven't a clue how to get the
shape to start at the bottom.

Thanks in advance,
MJohn




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default TopLeftCell change to "bottom"LeftCell

No problem - I will most likely use it myself one day...

--
Tim Williams
Palo Alto, CA


"M John" wrote in message ...
Thanks again. You've been a star.

Most appreciated.

MJohn

"Tim Williams" wrote:

Sub Proportionally_Fill()

Dim c As Range
Dim v As Single
Dim s As Shape
Dim x

For Each c In Selection
If c.Value = 0 And c.Value <= 1 Then

v = c.Value
x = v * c.Height
Set s = ActiveSheet.Shapes.AddShape(msoShapeRectangle, _
c.Left, (c.Top + c.Height) - x, c.Width, x)
s.Fill.Visible = msoTrue
s.Fill.ForeColor.SchemeColor = 17
s.Line.Visible = msoFalse
Selection.Font.ColorIndex = 2
End If
Next c
End Sub



--
Tim Williams
Palo Alto, CA


"M John" wrote in message ...
Hello,
I've got a macro (thanks to users here) that inserts a rectangle that fills
a cell proportionally based on the contents of the cell. I would like to
modify it so that the shape starts from the bottom and fills (top to bottom)
proportionally. Here's the macro as it is now:

Sub Proportionally_Fill()

Dim c As Range
Dim v As Single
Dim s As Shape

For Each c In Selection
If c.Value = 0 And c.Value <= 1 Then

v = c.Value
Set s = ActiveSheet.Shapes.AddShape(msoShapeRectangle, _
c.Left, c.Top, c.Width * v, c.Height)
s.Fill.Visible = msoTrue
s.Fill.ForeColor.SchemeColor = 17
s.Line.Visible = msoFalse
Selection.Font.ColorIndex = 2
End If
Next c
End Sub

I can get the overall shape centered, but haven't a clue how to get the
shape to start at the bottom.

Thanks in advance,
MJohn






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
Turn off "CALCULATE" on bottom of Excel worksheet. near "Ready" chrispal86 Excel Discussion (Misc queries) 2 February 2nd 10 08:36 PM
How do I change the column heading in Excel to display "A" "B" "C Thai New Users to Excel 1 November 30th 07 08:06 PM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
=IF(D13="PAID","YES","NO") Can I change fonts colour Kev Excel Discussion (Misc queries) 3 February 17th 06 04:27 AM
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc Bob Reynolds[_2_] Excel Programming 0 March 4th 04 08:52 PM


All times are GMT +1. The time now is 06:57 PM.

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

About Us

"It's about Microsoft Excel"