Aug 06 2021 07:39 AM
...is there a way to "glue" cells in Excel?
If you have three cells (all containing independent, unrelated values) that you often copy and paste as a group, just from one area of a spreadsheet to another, is there a way to glue them so that you only have to click once--in any area of the three cells--to select all three and move or copy them as a group?
Any advice appreciated,
Alicia
Aug 06 2021 08:40 AM
As you guessed, tha answer is no.
Aug 06 2021 05:42 PM
Solution
If a vba solution is acceptable, then I think you may be able to do that.
If you select the cells and give them a name (say "MyGroup", for example), then right click on your worksheet, click view code, and paste this into the code window, then it should select the group of cells whenever you select one of them. Just change the range name in the code to whatever you decide to use.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Me.Range("MyGroup")) Is Nothing Then
Application.EnableEvents = False
Me.Range("MyGroup").Select
Application.EnableEvents = True
End If
End Sub
Aug 16 2021 12:38 PM - edited Aug 16 2021 12:39 PM
Hi JMB17,
This is a little bit above my pay grade but I think I have someone who can help me with it. I have a couple of questions first...
If the cells I am grouping have different values (text on the left and time on the right), will each cell retain its original properties, i.e., EXCEL will recognize the number on the right as an expression of hours and minutes and be able to perform calculations as usual, as long as I have previously chosen that number format for that cell?
I would have to choose a unique range name for each pair of cells, wouldn't I?
Thanks for your help!
A.
Aug 16 2021 12:45 PM
Aug 06 2021 05:42 PM
Solution
If a vba solution is acceptable, then I think you may be able to do that.
If you select the cells and give them a name (say "MyGroup", for example), then right click on your worksheet, click view code, and paste this into the code window, then it should select the group of cells whenever you select one of them. Just change the range name in the code to whatever you decide to use.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Me.Range("MyGroup")) Is Nothing Then
Application.EnableEvents = False
Me.Range("MyGroup").Select
Application.EnableEvents = True
End If
End Sub