Chamfer Cells

B

Bill

Hi,
I have a work sheet and the gridlines are tuned off.
The work sheet has a white backround and has groups of cells green in colour
within the white backround. Is it possible to chamfer the corners of the
green cells for aesthetic purposes?

Thanking you in advance.
 
G

Gord Dibben

Bill

First clear the background green color then select a range of cells and run this
macro to produce a semi-transparent colored shape over the cells.

Note: you can select multiple ranges to run on.

Sub RoundRectangle()
Dim X, y As Single, area As Range
For Each area In Selection.Areas
With area
X = .Height * 0#
y = .Width * 0#
ActiveSheet.Rectangles.Add Top:=.Top - X, Left:=.Left - y, _
Height:=.Height + 1 * X, Width:=.Width + 1 * y
End With
With ActiveSheet.Rectangles(ActiveSheet.Rectangles.Count)
.Interior.ColorIndex = 10
.ShapeRange.AutoShapeType = msoShapeRoundedRectangle
.ShapeRange.Fill.Transparency = 0.8
.ShapeRange.Line.Weight = 1.25
End With
Next area
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top