I have a table that has two separate rows of data that each function separately and need to have their rows hidden. Thus the table is being split into two, its rows are being hidden accordingly, and the I saw it back together via linking the second part as a picture to the first part, with this code:
However, when the rows need to be refreshed (via a massive Unhide/Hide macro) the linked picture needs to either be deleted or linked/unlinked.
I have found this macro helps deleting:
But it deletes each and every object/picture in the sheet.
Does anyone know if there is a way to keep the picture permanent and link/unlink it on demand via VBA - or a way to delete that specific linked image so I can rerun the picture link macro each time?
Code:
Sub Linked_Picture_Paste()
Range("C145:K255").Copy
Range("N22").Select
Pictures.Paste(Link:=True).Select
Application.CutCopyMode = False
End Sub
However, when the rows need to be refreshed (via a massive Unhide/Hide macro) the linked picture needs to either be deleted or linked/unlinked.
I have found this macro helps deleting:
Code:
Sub Delete_All_Pictures()
Dim Pic As Object
For Each Pic In ActiveSheet.Pictures
Pic.Delete
Next Pic
End Sub
But it deletes each and every object/picture in the sheet.
Does anyone know if there is a way to keep the picture permanent and link/unlink it on demand via VBA - or a way to delete that specific linked image so I can rerun the picture link macro each time?