PDA

View Full Version : Solved: Need to set textbox to the width between Column 1 and column 24



frank_m
04-19-2011, 06:35 AM
I know this syntax is wrong but I need something similar to--ActiveCell.Column (1), Column(24).Width

Thanks
Sub Macro1()

Dim LeftPos As Integer, TopPos As Integer, intWidth As Integer, intHeight As Integer
Dim shp As Shape

ActiveSheet.TextBoxes.Delete

LeftPos = 0
TopPos = ActiveCell.Top + ActiveCell.Height + 1
intWidth = 1350 ' need width of column 1 to 24
intHeight = 0.75

Set shp = ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, _
LeftPos, TopPos, intWidth, intHeight)


With shp
.Name = "BottomOfRowIndicator"
.Line.ForeColor.SchemeColor = 10
End With

End Sub

frank_m
04-19-2011, 06:57 AM
I looked through some other code that you people here have been so kind to supply me with in the past, and modified something I felt was similar to the following:
ActiveCell.EntireRow.Cells(1).Resize(, 24).Width It works, but Question is , is what I did good? or is it laughable?
(my wisdom has not grown enough to know the difference. :cool: )
Any alternative commands?

mikerickson
04-19-2011, 07:16 AM
It works, therefore you've done good.
You understand it, therefore you've done very good.