Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Not getting the result I was hoping for

This code is using the current (active) Worksheet to provide the list data
not Friday Workshifts. Can any one tell me what I have missed?



Private Sub UserForm_Initialize()
With Worksheets("Friday Workshifts")
ListBox1.RowSource = "$A$2:$R$200"
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Not getting the result I was hoping for

Private Sub UserForm_Initialize()
Dim ws As Worksheet
Dim curCell As Variant
Dim r As Long
Set ws = Worksheets("Friday Workshifts")
ListBox1.Clear
For r = 2 To 200
Set curCell = ws.Range("A" & r)
If Not IsEmpty(curCell) Then
ListBox1.AddItem (curCell)
End If
Next
End Sub

"Patrick C. Simonds" wrote:

This code is using the current (active) Worksheet to provide the list data
not Friday Workshifts. Can any one tell me what I have missed?



Private Sub UserForm_Initialize()
With Worksheets("Friday Workshifts")
ListBox1.RowSource = "$A$2:$R$200"
End With
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
hoping for help [email protected] Excel Programming 1 May 9th 07 08:23 PM
Hoping [email protected] Excel Programming 1 August 24th 06 01:38 AM
Can you automatically scale text in a graph? I'm hoping there's a way! nbaj2k[_44_] Excel Programming 2 August 15th 06 01:08 PM
simple i am hoping with macros chip_pyp Excel Discussion (Misc queries) 1 March 26th 06 04:14 PM
Hoping its an easy question mazzarin Excel Programming 4 March 6th 06 02:33 PM


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