#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default ComboBox Question

I am trying to fill a combo box in a user form from a range. I do not
want every cell in range. I want the cell value to be added only if
cell.row mod 4 = 0. Can this be done? How?

Thanks,
Jay
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default ComboBox Question

Something like this maybe (assuming your data is in Column B for this
example)...

Dim X As Long, LastRow As Long
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
For X = 4 To LastRow Step 4
Me.ComboBox1.AddItem Cells(X, "B").Value
Next

--
Rick (MVP - Excel)


"jlclyde" wrote in message
...
I am trying to fill a combo box in a user form from a range. I do not
want every cell in range. I want the cell value to be added only if
cell.row mod 4 = 0. Can this be done? How?

Thanks,
Jay


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default ComboBox Question

On Aug 27, 1:47*pm, "Rick Rothstein"
wrote:
Something like this maybe (assuming your data is in Column B for this
example)...

* Dim X As Long, LastRow As Long
* LastRow = Cells(Rows.Count, "B").End(xlUp).Row
* For X = 4 To LastRow Step 4
* * Me.ComboBox1.AddItem Cells(X, "B").Value
* Next

--
Rick (MVP - Excel)

"jlclyde" wrote in message

...



I am trying to fill a combo box in a user form from a range. *I do not
want every cell in range. *I want the cell value to be added only if
cell.row mod 4 = 0. *Can this be done? *How?


Thanks,
Jay- Hide quoted text -


- Show quoted text -


Rick,
I can work with this. Thanks for the code. I was trying to do it
with an array and not having any luck setting that.
Thanks,
Jay
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
Userform combobox question teepee Excel Discussion (Misc queries) 2 May 17th 07 09:22 AM
another combobox question teepee Excel Discussion (Misc queries) 2 May 13th 07 01:01 AM
ComboBox Question Duncan Edment Excel Worksheet Functions 1 August 1st 06 12:42 PM
combobox Question Greg B Excel Discussion (Misc queries) 2 September 2nd 05 04:22 PM
VBA Form ComboBox question WTG Excel Worksheet Functions 3 February 26th 05 04:27 PM


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