PC Review


Reply
Thread Tools Rate Thread

Create a activecell from the listbox?

 
 
Oggy
Guest
Posts: n/a
 
      6th Jan 2007
Hi
Does anyone have a code for making my selection in a listbox on a form
my activecell in the worksheet.

Thanks in advance

 
Reply With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      7th Jan 2007
Making several assumptions:

Private Sub Listbox1_Click()
Dim rng as Range
set rng = Range(me.Listbox1.RowSource)
rng.columns(1).Cells(me.Listbox1.ListIndex + 1).Select
End Sub

--
Regards,
Tom Ogilvy

"Oggy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
> Does anyone have a code for making my selection in a listbox on a form
> my activecell in the worksheet.
>
> Thanks in advance
>



 
Reply With Quote
 
=?Utf-8?B?TWFydGluIEZpc2hsb2Nr?=
Guest
Posts: n/a
 
      7th Jan 2007
On the form you presumably have an ok or goto button (here CommandButton1)
and a the double_click event for the list box (here ListBox1).

Set up these three sub as try it would assuming you have a the two controls.

Private Sub CommandButton1_Click()
ActiveSheet.Range(ListBox1.Value).Select
Me.Hide
Unload Me
End Sub

Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
CommandButton1_Click
End Sub

Private Sub UserForm_Initialize()
ListBox1.AddItem "A1"
ListBox1.AddItem "B2"
ListBox1.AddItem "C3"
End Sub


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Oggy" wrote:

> Hi
> Does anyone have a code for making my selection in a listbox on a form
> my activecell in the worksheet.
>
> Thanks in advance
>
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      7th Jan 2007
Activecell.value = Me.ListBox1.Value

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Oggy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
> Does anyone have a code for making my selection in a listbox on a form
> my activecell in the worksheet.
>
> Thanks in advance
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Microsoft Excel Misc 1 2nd Oct 2007 08:05 PM
Userform, listbox and ActiveCell. I'm stumped =?Utf-8?B?RGF2ZXlKb25lcw==?= Microsoft Excel Programming 4 7th Sep 2006 01:04 PM
CREATE NEW WORKBOOKS BASED ON ACTIVECELL & BUTTON CLICK =?Utf-8?B?RWRkeSBTdGFu?= Microsoft Excel Programming 5 1st Jul 2006 06:32 AM
how to drag and drop from a listbox to activecell with vba ? ka Microsoft Excel Programming 2 24th Jun 2006 02:15 PM
Paste Multiple listbox items starting at ActiveCell Casey Microsoft Excel Programming 5 8th Apr 2006 07:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:01 PM.