Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Create a activecell from the listbox?

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

Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Create a activecell from the listbox?

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" wrote in message
oups.com...
Hi
Does anyone have a code for making my selection in a listbox on a form
my activecell in the worksheet.

Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Create a activecell from the listbox?

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Create a activecell from the listbox?

Activecell.value = Me.ListBox1.Value

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Oggy" wrote in message
oups.com...
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
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
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Userform, listbox and ActiveCell. I'm stumped DaveyJones Excel Programming 4 September 7th 06 01:04 PM
CREATE NEW WORKBOOKS BASED ON ACTIVECELL & BUTTON CLICK Eddy Stan Excel Programming 5 July 1st 06 06:32 AM
how to drag and drop from a listbox to activecell with vba ? ka Excel Programming 2 June 24th 06 02:15 PM
Paste Multiple listbox items starting at ActiveCell Casey[_67_] Excel Programming 5 April 8th 06 07:45 PM


All times are GMT +1. The time now is 05:37 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"