Really Need Help: side effect clears clipboard!!!

B

Bura Tino

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
 
T

teatree

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
 
F

Frank Kabel

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
 
B

Bura Tino

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?)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top