Trevor Steward
New Member
- Joined
- Jul 11, 2020
- Messages
- 10
- Office Version
- 365
- Platform
- Windows
- MacOS
Please help if you can.
The code below is to insert a new line at a row referenced from "uc" then copy the checkbox from a previous row and assigning the correct linked cell for the checkbox.
It works upto the line where the linked cell is assigned (row inserted and checkbox created) , the line is shown below should link the cell to the checkbox.
Selection.LinkedCell = ActiveWindow.RangeSelection.Address
Thanks
The code below is to insert a new line at a row referenced from "uc" then copy the checkbox from a previous row and assigning the correct linked cell for the checkbox.
It works upto the line where the linked cell is assigned (row inserted and checkbox created) , the line is shown below should link the cell to the checkbox.
Selection.LinkedCell = ActiveWindow.RangeSelection.Address
VBA Code:
ActiveCell.Offset(-1, 0).Range("A1:P1").Select
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1:P1").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.RowHeight = 15
'Application.CutCopyMode = False
' Copy Inc? CheckBox1 on top line
ActiveSheet.Shapes("CheckBox1").Select
Selection.Copy
ActiveSheet.Range("uc").Activate
ActiveCell.Offset(-2, 5).Range("A1").Select
ActiveSheet.Paste
Selection.LinkedCell = ActiveWindow.RangeSelection.Address
' Copy Dom? CheckBox2 on top line
ActiveSheet.Shapes("CheckBox2").Select
Selection.Copy
ActiveSheet.Range("uc").Activate
ActiveCell.Offset(-2, 6).Range("A1").Select
ActiveSheet.Paste
Selection.LinkedCell = ActiveWindow.RangeSelection.Address
' Copy Prob Dist ComboBox1 Box on top line
ActiveSheet.Shapes("ComboBox1").Select
Selection.Copy
ActiveSheet.Range("uc").Activate
ActiveCell.Offset(-2, 10).Range("A1").Select
ActiveSheet.Paste
Selection.LinkedCell = ActiveWindow.RangeSelection.Address
' Done
ActiveSheet.Range("uc").Activate
End Sub
Thanks