Excel 2007 Macro Record

  • Thread starter Thread starter jnf40
  • Start date Start date
J

jnf40

I am recording a macr for the code to resize and change the format for a
Rectangle. All it is recording is the cells that are selected, it shows
nothing about the formatting of the Rectangle. Any thoughts?
 
Excel 2007's macro record capability are extremely poor. I recorded the
following that may be of some help to you:

ActiveSheet.Shapes.AddShape(msoShapeRectangle, 61.5, 51.75, 80.25,
64.5). _
Select
Range("C13").Select
ActiveSheet.Shapes("Rectangle 1").Select
Selection.ShapeRange.ScaleWidth 0.65, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.64, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.IncrementLeft -0.75
Selection.ShapeRange.IncrementTop 72.75

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 
Thanks for the response. What I have here works for
making the interior color Yellow:

ActiveSheet.Shapes("Rectangle 1").Select
With Selection.Interior
..ColorIndex = 27
End With

but I want to make the yellow transparent by 80%
so that the user can see through the shape.
 
Thanks again for your response Bob, I finally figured it out
with the following code.

ActiveSheet.Shapes("Rectangle 1").Select
With Selection.ShapeRange.Fill
..ForeColor.SchemeColor = 13
..Transparency = 0.8
End With
 
Give this a try...

With Worksheets("Sheet1").Shapes("Rectangle 1").Fill
.ForeColor.RGB = RGB(255, 255, 0)
.Transparency = 0.8
End With

The closer the Transparency value is to 1, the more transparent it is.

Rick
 

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

Back
Top