![]() |
Excel 2007 Macro Record
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 Macro Record
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 "jnf40" wrote in message ... 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 Macro Record
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. "Bob Flanagan" wrote: 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 "jnf40" wrote in message ... 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 Macro Record
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 "jnf40" wrote: 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. "Bob Flanagan" wrote: 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 "jnf40" wrote in message ... 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 Macro Record
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 "jnf40" wrote in message ... 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. "Bob Flanagan" wrote: 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 "jnf40" wrote in message ... 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? |
All times are GMT +1. The time now is 07:48 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com