Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a procedure (shown below) which makes a Controls Toolbar button vizible if "A1" is selected. An unfortunate side effect is that having this procedure kills the ability to copy and paste -- if something had been selected and copied, it disappears once any other cell is clicked. Can anyone suggest a work around? Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Target.Address = "$A$1" Then AddFundButton.Visible = True Else AddFundButton.Visible = False End If End Sub Many thanks in advance, Bura |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
odd. it works for me.
i had to change the AddFundButton t ActiveSheet.Shapes("AddFundButton") but that is the only thing modified. i was able to copy from the page with the button to anothe sheet, and from a sheet to the button page, and activate/deactivate th button in-between. I'm using excel 97 on win 98. Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Target.Address = "$A$1" Then ActiveSheet.Shapes("AddFundButton").Visible = True Else ActiveSheet.Shapes("AddFundButton").Visible = False End If End Sub it might have something to do with the "Selection change" since you'l be doing that when you pick a target range for your copied cells. tr tying the event to something else, like doubleclick... in that case you might want to eliminate your Else statement, and have the butto toggle on/off when A1 is doubleclicked, see if this will work fo you... Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range Cancel As Boolean) If Target.Address = "$A$1" Then With ActiveSheet.Shapes("AddFundButton") .Visible = Not .Visible End With End If End Su -- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
not tested but give it a try Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) static status If Target.Address = "$A$1" Then AddFundButton.Visible = True status = True Elseif status AddFundButton.Visible = False status = False End If End Sub -- Regards Frank Kabel Frankfurt, Germany Bura Tino wrote: Hi, I have a procedure (shown below) which makes a Controls Toolbar button vizible if "A1" is selected. An unfortunate side effect is that having this procedure kills the ability to copy and paste -- if something had been selected and copied, it disappears once any other cell is clicked. Can anyone suggest a work around? Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Target.Address = "$A$1" Then AddFundButton.Visible = True Else AddFundButton.Visible = False End If End Sub Many thanks in advance, Bura |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
not tested but give it a try Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) static status If Target.Address = "$A$1" Then AddFundButton.Visible = True status = True Elseif status AddFundButton.Visible = False status = False End If End Sub This does help, but I still can't paste TO or FROM A1. (What's MS's design thinking behind this feature of clipboard clearing upon certain actions?) -- Regards Frank Kabel Frankfurt, Germany Bura Tino wrote: Hi, I have a procedure (shown below) which makes a Controls Toolbar button vizible if "A1" is selected. An unfortunate side effect is that having this procedure kills the ability to copy and paste -- if something had been selected and copied, it disappears once any other cell is clicked. Can anyone suggest a work around? Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) If Target.Address = "$A$1" Then AddFundButton.Visible = True Else AddFundButton.Visible = False End If End Sub Many thanks in advance, Bura |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
launching Excel clears clipboard | Excel Discussion (Misc queries) | |||
How to permantently hide clipboard pane on the right side of Word/Excel 2003? | Excel Discussion (Misc queries) | |||
How2 setup one page distribution report side by side results | Charts and Charting in Excel | |||
Strange behaviour - loading Excel clears Clipboard | Excel Discussion (Misc queries) | |||
Display columns side by Side in the Data Area of a Pivot table | Excel Discussion (Misc queries) |