Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default short cut needed for listbox(sorry a bit long)

Hi,
Eralier I post a question, but couldn`t get the answer but I think I fixed
my problem. But still I think in a weird wayI have to array one is e6:e20
second is pmlist. i have a code which randomly assign values from the array
pmlist.In the end I want to see the values from "pmlist" which is not
assigned to e6:e20 array.I couldn`t make it but instead I wrote a formula in
that "pmlist" array in the excel sheet which can tell me those values
assigned or not then wrote a following code to show those not assigned in the
list box.:
Option Explicit
Private pmlist As Range

Private Sub UserForm_Initialize()
Set pmlist = ThisWorkbook.Names("pmlist").RefersToRange
Dim Cell As Range
For Each Cell In pmlist.Columns(1).Cells
If Cell.Value = "not rostered" Then
ListBox2.AddItem Cell.Offset(0, 3).Value
ListBox2.List(ListBox2.ListCount - 1, 1) = Cell.Offset(0, 4)
ListBox2.List(ListBox2.ListCount - 1, 2) = UCase(Cell.Offset(0, 4)) '
ListBox2.TextColumn = 3
End If
Next
End Sub
Private Sub UserForm_Terminate()
Set pmlist = Nothing
End Sub
But this look very long way to do it,anybody help me to make a short cut

--
Regards,
Baha
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 do I change a long columns list to short ones in 2007 Excel? FitGurlFlea Excel Discussion (Misc queries) 1 February 19th 10 02:46 PM
From long dropdown to a short one XLFanatico Excel Discussion (Misc queries) 1 June 8th 09 06:02 AM
I can't save long file names, only short one, how can I do this? short file names Excel Discussion (Misc queries) 0 January 3rd 06 05:13 PM
How to reshape data sets between long and short form as in stata? Phillip Killicoat Excel Programming 0 July 8th 05 02:28 PM
How do i break really long bars to show short ones in Excel? nkchu83 Charts and Charting in Excel 2 May 26th 05 07:44 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"