Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default userform listbox cannot get listbox.value to transfer back to main sub

hi
when i insert listboxes into a userform, the listbox.values that i
select aren't accessible back in my main program. i thought that if i
clicked on the listbox and then just hit the commandbutton, the value
that i clicked would be accessible back in my subroutine, but it's not.
what code am i missing in my userform code?

thanx
sam

sub XX ()
dim myform as new userform
myform show
activecell.value = listbox1.value
end sub

(actual userform code below)

Private Sub cmdend_Click()
Hide
End Sub

Private Sub ListBox1_Click()
End Sub

Private Sub UserForm_Initialize()
ListBox1.AddItem "Hosp Vist Mod"
ListBox1.AddItem "Hosp Vist Complex"
ListBox1.AddItem "Hosp Consult Mod"
ListBox1.AddItem "Hosp Consult Complex"
ListBox1.AddItem "Hosp Admission"
ListBox1.AddItem "H&P"
ListBox2.AddItem "30 minutes ICU detention time"
ListBox2.AddItem "inpt echocardiogram interp."
ListBox2.AddItem "inpt holter interp."
ListBox2.AddItem "inpt right heart cath only"
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default userform listbox cannot get listbox.value to transfer back to main sub

try pulling the listbox1.text as opposed to listbox1.value ;-)


--
Wendell A. Clark, BS
-------------------------------------

CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may
contain confidential and privileged information for the use of the
designated recipients named above. If you are not the intended recipient,
please notify us by reply e-mail. You are hereby notified that you have
received this communication in error and that any review, disclosure,
dissemination, distribution or copying of it or its contents is prohibited.
If you have received this communication in error, please destroy all copies
of this communication and any attachments. Contact the sender if it
continues.


wrote in message
ups.com...
hi
when i insert listboxes into a userform, the listbox.values that i
select aren't accessible back in my main program. i thought that if i
clicked on the listbox and then just hit the commandbutton, the value
that i clicked would be accessible back in my subroutine, but it's not.
what code am i missing in my userform code?

thanx
sam

sub XX ()
dim myform as new userform
myform show
activecell.value = listbox1.value
end sub

(actual userform code below)

Private Sub cmdend_Click()
Hide
End Sub

Private Sub ListBox1_Click()
End Sub

Private Sub UserForm_Initialize()
ListBox1.AddItem "Hosp Vist Mod"
ListBox1.AddItem "Hosp Vist Complex"
ListBox1.AddItem "Hosp Consult Mod"
ListBox1.AddItem "Hosp Consult Complex"
ListBox1.AddItem "Hosp Admission"
ListBox1.AddItem "H&P"
ListBox2.AddItem "30 minutes ICU detention time"
ListBox2.AddItem "inpt echocardiogram interp."
ListBox2.AddItem "inpt holter interp."
ListBox2.AddItem "inpt right heart cath only"
End Sub



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
DONT WANT TO SEE LISTBOX SELEXTED ITEMS WHEN COME BACK TO LIST BOX CAPTGNVR Excel Discussion (Misc queries) 0 January 29th 07 08:44 PM
VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox) modjoe23 Excel Programming 3 August 18th 05 02:35 PM
transfer data in listbox Glen Mettler[_2_] Excel Programming 1 September 24th 04 10:44 AM
Transfer multiple columns items form listbox to range Rolo[_3_] Excel Programming 3 November 15th 03 06:50 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM


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