#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Loop Edit

The below code looks for values in the specified range and
adds that value to the listbox. What I would like is for
the code to skip over column Z(not add the value to the
list box) even if there is a value in that column in that
row. How would I do this?

Also I want the code to not add a value to the listbox if
it is is equal to "test".

Private Sub UserForm_Initialize()
Dim Rng As Range
With ListBox1
'Or With ComboBox1
.ColumnCount = 1
For Each Rng In Range("A4:AB4").Cells
If Rng.Text < "" Then
.AddItem Rng.Text
End If
Next Rng
End With

End Sub


Thanx,

Todd
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
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
Loop ? chrisnsmith Excel Discussion (Misc queries) 6 February 21st 09 03:54 PM
Loop Wanna Learn Excel Discussion (Misc queries) 5 January 31st 07 05:21 PM
Edit this macro code to loop and end GarToms Excel Discussion (Misc queries) 1 January 27th 06 12:50 PM
Why can't I edit my excel document? Edit buttons shaded. Arl @ CBC New Users to Excel 3 September 7th 05 01:18 AM


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