LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Change event to add button

Hi,
I am trying to create a worksheet change event where when a user pastes a group of cells onto a page a print button appears on the page. The problem is that the code runs twice (the second when it hits Cells(1,1).Select) and I get an out of memory error on Target.Value. The code is poted below.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells(1, 1).Select
If Target.Address = "$A$1" And Target.Value < "" And x = 0 Then
Buttons.Delete
Buttons.Add(624, 15, 48, 15).Select
With Selection
.Caption = "Print"
.OnAction = "Print_Tickets"
End With
x = x + 1
Cells(1, 1).Select
End If
End Sub

So, the question is, how do I get the emphasis taken off of the button, so I don't have to use Cells(1, 1).Select to do it?
Thanks.
James

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
apply cell change event to single column - WorksheetChange Event [email protected] Excel Programming 6 May 4th 08 02:28 AM
Worksheet change event - Spinner button transferxxx Excel Programming 5 August 7th 07 03:50 PM
How do I change a Worksheet_change event to a beforesave event? Tueanker Excel Programming 5 June 29th 07 03:00 PM
MsgBox in Enter event causes combobox not to run Change event Richard Excel Programming 0 March 6th 06 02:52 PM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"