将macrosbutton添加到单元格

我的电子表格将被那些没有任何/很less的excel经验的人使用,所以我已经为他们创build了macros来使它更容易。

我现在面临的问题是,如果他们将数据添加到新行,我想要创build一个新的macrosbutton。 macrosbutton将是它上面的一个副本。

基本上,在列E是button,关联的macros打开一个隐藏的页面,并过滤在D列(相应的行)find的单词,

我想我需要的是,当其他macros返回到原来的页面在D列中查找,并确保E列中有一个button,如果不复制上面的单元格中的macrosbutton,并将其粘贴到E.

'find content of the cell the button is on Dim b As Object, RowNumber As Integer Set b = ActiveSheet.Buttons(Application.Caller) With b.TopLeftCell RowNumber = .Row End With protocolName = Range("D" & RowNumber).Value 'swap sheets and hide the other Sheets("Protocols").Visible = True Sheets("Orderables with Protocols").Visible = False Sheets("Protocols").Select ActiveSheet.Range("B:B").AutoFilter Field:=1, Criteria1:=protocolName Range("A1").Select 

任何人都可以帮助请