mcallaghan
New Member
- Joined
- May 3, 2013
- Messages
- 19
Hello!
I currently have a button that creates a rectangle the size of the active cell at the activecell. Macro as follows.
Sub Add_rectangle()
Dim rng As Range
Dim lab As Object
Set rng = ActiveCell
ActiveSheet.Rectangles.Add(197.25, 108.75, 42.75, 57.75).Select
Set lab = Selection
With lab
.Top = rng.Top
.Left = rng.Left
.Width = rng.Width
.Height = rng.RowHeight
.Interior.Color = RGB(255, 0, 0)
End With
'
End Sub
Now,
I'd like to be a scroll bar or a pair of buttons if that is not possible, that would increase the width of the rectangle rightwards to cover adjacent cells, and move the whole box leftwards.
Any ideas?
I currently have a button that creates a rectangle the size of the active cell at the activecell. Macro as follows.
Sub Add_rectangle()
Dim rng As Range
Dim lab As Object
Set rng = ActiveCell
ActiveSheet.Rectangles.Add(197.25, 108.75, 42.75, 57.75).Select
Set lab = Selection
With lab
.Top = rng.Top
.Left = rng.Left
.Width = rng.Width
.Height = rng.RowHeight
.Interior.Color = RGB(255, 0, 0)
End With
'
End Sub
Now,
I'd like to be a scroll bar or a pair of buttons if that is not possible, that would increase the width of the rectangle rightwards to cover adjacent cells, and move the whole box leftwards.
Any ideas?