#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Form

I am still having trouble loading this form. It is nothing
to do with the name as i cannot even load it from the
Visual Basic Menu with the play button.

I have pasted the code for Initialise event if this helps.

I get the following message 'Object Required'

TIA


Private Sub UserForm_Initialize()
Dim ListItems As Variant, i As Integer
Dim SourceWB As Workbook

With Form_Suppliers.ListBox1
.Clear
Set SourceSh = Worksheets("Email_Control")

ListItems = SourceSh.Range("A1:A" & Range
("A65536").End(xlUp).Row).Value
Application.ScreenUpdating = True
ListItems = Application.WorksheetFunction.Transpose
(ListItems)
For i = 1 To UBound(ListItems)
.AddItem ListItems(i)
Next i
.ListIndex = -1
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Form

I don't see anything obviously wrong, but you could simplify it

Private Sub UserForm_Initialize()
Dim rng as Range
With Worksheets("Email_Control")
set rng = .Range(.Cells(1,1),.Cells(rows.count,1).End(xlup))
End With
With me.ListBox1
.Clear
.list = rng.Value
End With

--
Regards,
Tom Ogilvy

"Edgar Thoemmes" wrote in message
...
I am still having trouble loading this form. It is nothing
to do with the name as i cannot even load it from the
Visual Basic Menu with the play button.

I have pasted the code for Initialise event if this helps.

I get the following message 'Object Required'

TIA


Private Sub UserForm_Initialize()
Dim ListItems As Variant, i As Integer
Dim SourceWB As Workbook

With Form_Suppliers.ListBox1
.Clear
Set SourceSh = Worksheets("Email_Control")

ListItems = SourceSh.Range("A1:A" & Range
("A65536").End(xlUp).Row).Value
Application.ScreenUpdating = True
ListItems = Application.WorksheetFunction.Transpose
(ListItems)
For i = 1 To UBound(ListItems)
.AddItem ListItems(i)
Next i
.ListIndex = -1
End With



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
Formula (off form) that completes form data based on a result lldiel Excel Worksheet Functions 2 November 24th 09 11:09 PM
excel form. Need data extracted to spreadsheet each time a form co MikeR-Oz Excel Discussion (Misc queries) 4 April 5th 09 05:18 AM
Using a template form, advance a form number everytime you open ShoDan Excel Discussion (Misc queries) 1 January 31st 08 01:34 PM
Can a form made in Excel 2002 be converted into a fillable form? Paraclete Excel Discussion (Misc queries) 1 February 20th 07 09:20 PM
how can I make a form number change everytime the form is opened babydumplingspita Excel Worksheet Functions 1 October 10th 05 07:58 PM


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