I try moving multiple shapes to last empty column when select cell but it gives error in this line
all of the shapes are buttons
VBA Code:
For Each NofB In Shapes(Array("INSROW", "INSMONTH", "DELROW"))
VBA Code:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
Dim LastColFind As Long
Dim NofB As Variant
For Each NofB In Shapes(Array("INSROW", "INSMONTH", "DELROW"))
LastColFind = ActiveSheet.Cells.Find("*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
With Target
Me.Shapes("BUTTON " & NofB).Top = .Top
Me.Shapes("BUTTON " & NofB).Left = ActiveSheet.Cells(1, LastColFind + 1).Left + 2
End With
Next NofB
End Sub