Bill Hamilton
Board Regular
- Joined
- Mar 30, 2004
- Messages
- 95
Hi,
I want to create a standard text box on a standard sheet with VBA without having to select it at any point. It will have a formula in it to point to a cell range which will change over the period the macro is running to give the users something to look at to stop them getting bored. I recorded the creation process for the box with the name and format I want and this is what it gave me (more or less):
Could someone cleverer than I am convert that to a version which doesn't 'select' anything, please? I get really confused with shapes and their properties etc and everything I've tried using Withs has failed.
Hope someone can help.
I want to create a standard text box on a standard sheet with VBA without having to select it at any point. It will have a formula in it to point to a cell range which will change over the period the macro is running to give the users something to look at to stop them getting bored. I recorded the creation process for the box with the name and format I want and this is what it gave me (more or less):
Code:
Sub Macro3()
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 664, 90, 224, 86).Select
Application.Goto Reference:="StatusBox"
Selection.Formula = "=StatusBoxContents"
With Selection.ShapeRange.TextFrame2.TextRange.Font
.Name = "Tahoma"
.Size = 11
.Bold = True
End With
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 0, 0)
.Transparency = 0
.Weight = 1.5
End With
End Sub
Could someone cleverer than I am convert that to a version which doesn't 'select' anything, please? I get really confused with shapes and their properties etc and everything I've tried using Withs has failed.
Hope someone can help.