ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Maintaining Macros on a sheet when it is saved as a new workbook (https://www.excelbanter.com/excel-programming/428696-maintaining-macros-sheet-when-saved-new-workbook.html)

Tony Bender

Maintaining Macros on a sheet when it is saved as a new workbook
 
I have an application where via one macro the user can double-click on
a specific cell and it pops up a TextBox with a definition. Then they
can click on the TextBox to close it.

Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
'displays definition with a live example
If ActiveCell.Address = "$B$3" Then
Cancel = True
With ActiveSheet
.Shapes("Group1").Visible = True
End With

ElseIf ActiveCell.Address = "$J$3" Then
Cancel = True
With ActiveSheet
.Shapes("Group4").Visible = True
End With

End If
End Sub


Then through a separate macro the user can click on the TextBox to
close it.

Sub CloseTB1()
With ActiveSheet
.Shapes("Group1").Visible = False
End With
End Sub

These both reside on a sheet-tab named "Report".




All times are GMT +1. The time now is 08:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com