Peter,
When the user doubleclicks the evented worksheet, the handler checks if a
particular column is doubleclicked, and if yes proceeds to load a form in
memory and populates that with row info.
The evented sheet has too many columns to fit on a 21" screen. In the row
of the clicked cell, there are some cells that need to be visualized
closely together, so I use a form with some controls.
What I wanted to do was create a sheet from scratch using
.....Worksheets.Add, and then attach an event to it. Similar to adding
clickable DOM objects to a html page.
After posting here I discovered a page by Chip Pearson explaining how to,
but it is too involved for this project. Since I only need to add one
worksheet in this particular subroutine, I'll go easy and unhide an
existing sheet, with a hardcoded eventhandler. For the enduser it's the
same magic.
thx for your help
Ward
See "Creating An Event Procedure" here :
http://www.cpearson.com/excel/vbe.aspx ,
"Peter T" <peter_t@discussions> wrote in
news:(E-Mail Removed):
> Not sure what you are asking, and what the relevance of the
> DoubleClick event is. Maybe you simply want something like this
>
> Private Sub Workbook_NewSheet(ByVal Sh As Object)
> If TypeName(Sh) = "Worksheet" Then
> Set gwsUpload = Sh
> MsgBox Sh.Name & " assigned to gwsUpLoad"
> ' code ?
> End If
> End Sub
>
> I am assuming gwsUpload is a global worksheet variable declared in a
> normal module
>
> If(?) you have a Form Ingave showing it might be better to update a
> Property in the Form and call some routine in the Form.
>
> Regards,
> Peter T
>
> "King Albert II" <(E-Mail Removed)> wrote in message
> news:Xns9D8C6EFFA467Dkingalbert2forpresid@69.16.176.253...
>> Hi,
>>
>>
>> I'd like to attach the eventhandler below, to any sheet that I add in
>> code like so : Set wsUpload = ThisWorkbook.Worksheets.Add
>>
>>
>>
>>
>> Private Sub Worksheet_BeforeDoubleClick(ByVal target As Range, Cancel
>> As Boolean)
>>
>>
>> Call bereikenmaken
>> If target.Column = Range("womschrijving").Column Then
>> Load Ingave
>> Call tonen(target)
>> Ingave.Show
>> End If
>>
>>
>> End Sub
>>
>>
>>
>>
>>
>> How can I do that ?
>>
>> thx
>>
>> Ward
>