I have a bit of code that works fine if I want to fill a cell with a button, but for my next venture into buttons I would like to make the height span two cells.
As an example
A5:A6 is a button
A7:A8 is a button
A9:A10 is a button
A11:A12 is a button
I can't figure out how to edit the loop to skip a row
Would I add something like
Range("A" & m + 6 & ":A" & m + 7)
Thank you
As an example
A5:A6 is a button
A7:A8 is a button
A9:A10 is a button
A11:A12 is a button
I can't figure out how to edit the loop to skip a row
VBA Code:
Dim var As Variant
Dim m As Long
var = Array("Sales", "Service", "Parts", "All")
For m = 0 To 3
With ActiveSheet.Buttons.Add(Range("A" & m + 6).Left, Range("A" & m + 6).Top, Range("A" & m + 6).Width, Range("A" & m + 6).Height)
.OnAction = "Dept" & (m)
.Characters.Text = var(m)
.Name = var(m)
.Placement = xlFreeFloating
End With
Would I add something like
Range("A" & m + 6 & ":A" & m + 7)
Thank you