Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Before Double Click Event

Hi all,
I have a BeforeDoubleClick on a worksheet that activates a user form for
entering data on to a sheet. What I want is for the value of the cell that I
double clicked to be entered in to a Combo Box (ComboBox1) on my userform.
If it is possible to write a code for this I would greatly appreciate some
help with the code.

Regards
gregork


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Before Double Click Event

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Dim frm As UserForm1

Set frm = New UserForm1
frm.ComboBox1.AddItem Target.Value
frm.Show

Set frm = Nothing
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gregork" wrote in message
...
Hi all,
I have a BeforeDoubleClick on a worksheet that activates a user form for
entering data on to a sheet. What I want is for the value of the cell that

I
double clicked to be entered in to a Combo Box (ComboBox1) on my userform.
If it is possible to write a code for this I would greatly appreciate some
help with the code.

Regards
gregork




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Before Double Click Event

Many thanks for the reply Rob. I pasted the code in to my worksheet event
and the userform shows when I double click but the cell value is not
transposed in to combobox1.
Any idea where I might be going wrong on this one?

Kind Regards
gregork
p.s -are you a kiwi?

"gregork" wrote in message
...
Hi all,
I have a BeforeDoubleClick on a worksheet that activates a user form for
entering data on to a sheet. What I want is for the value of the cell that

I
double clicked to be entered in to a Combo Box (ComboBox1) on my userform.
If it is possible to write a code for this I would greatly appreciate some
help with the code.

Regards
gregork




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Before Double Click Event

It may not be immediately visible until you use the Combo dropdown.
This can be tweaked by doing something with the ListIndex property.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Dim frm As UserForm1

Set frm = New UserForm1
frm.ComboBox1.AddItem Target.Value
With frm.ComboBox1: .ListIndex = .ListCount - 1: End With
frm.Show

Set frm = Nothing
End Sub


Another possibility is that you've got a ControlSource properties set.

The steps I went through:
1. New Workbook
2. Copy the event code to Sheet1
3. New UserForm (UserForm1)
4. New ComboBox on UserForm1 (ComboBox1)
5. Put some data into a cell, then doubleclick it.


Yep, I'm a Kiwi! Living in Whangarei (at least, just outside Whangarei)


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gregork" wrote in message
...
Many thanks for the reply Rob. I pasted the code in to my worksheet event
and the userform shows when I double click but the cell value is not
transposed in to combobox1.
Any idea where I might be going wrong on this one?

Kind Regards
gregork
p.s -are you a kiwi?

"gregork" wrote in message
...
Hi all,
I have a BeforeDoubleClick on a worksheet that activates a user form for
entering data on to a sheet. What I want is for the value of the cell

that
I
double clicked to be entered in to a Combo Box (ComboBox1) on my

userform.
If it is possible to write a code for this I would greatly appreciate

some
help with the code.

Regards
gregork






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Before Double Click Event

Thanks heaps Rob, the new code works perfectly. Good to know I can tap in to
some good old 'Kiwi ingenuity' on this newsgroup when I need it ;-)

Kind Regards
gregork

"Rob van Gelder" wrote in message
...
It may not be immediately visible until you use the Combo dropdown.
This can be tweaked by doing something with the ListIndex property.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Dim frm As UserForm1

Set frm = New UserForm1
frm.ComboBox1.AddItem Target.Value
With frm.ComboBox1: .ListIndex = .ListCount - 1: End With
frm.Show

Set frm = Nothing
End Sub


Another possibility is that you've got a ControlSource properties set.

The steps I went through:
1. New Workbook
2. Copy the event code to Sheet1
3. New UserForm (UserForm1)
4. New ComboBox on UserForm1 (ComboBox1)
5. Put some data into a cell, then doubleclick it.


Yep, I'm a Kiwi! Living in Whangarei (at least, just outside Whangarei)


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gregork" wrote in message
...
Many thanks for the reply Rob. I pasted the code in to my worksheet

event
and the userform shows when I double click but the cell value is not
transposed in to combobox1.
Any idea where I might be going wrong on this one?

Kind Regards
gregork
p.s -are you a kiwi?

"gregork" wrote in message
...
Hi all,
I have a BeforeDoubleClick on a worksheet that activates a user form

for
entering data on to a sheet. What I want is for the value of the cell

that
I
double clicked to be entered in to a Combo Box (ComboBox1) on my

userform.
If it is possible to write a code for this I would greatly appreciate

some
help with the code.

Regards
gregork








Reply
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
How to use selection change instead of double click event? ghost Excel Discussion (Misc queries) 1 December 26th 08 04:58 AM
How to change syperlink from single click to double click syperlinker Excel Worksheet Functions 0 June 13th 08 05:01 PM
Is there a double click event for cell? Ayo Excel Discussion (Misc queries) 3 June 6th 08 12:18 AM
Click on graph bar to execute a double-click in a pivot table cell [email protected] Charts and Charting in Excel 4 August 3rd 05 01:37 AM
Click Event Nichevo Excel Programming 2 December 4th 03 04:31 AM


All times are GMT +1. The time now is 02:37 PM.

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"