PC Review


Reply
Thread Tools Rate Thread

Change Combobox list to list more than 1 cell.value

 
 
Corey
Guest
Posts: n/a
 
      4th Jan 2007
The below code will list (conditionally) a value in the cell that is
..Offset(2, 0),
But i am trying to get it to list ALL cell values from .Offset(2, 0) to
..Offset(22,0).

How can i do this, the line highlighted is where the combobox is populated
from:

Private Sub ComboBox6_DropButtonClick()
Application.ScreenUpdating = False
'Place the References in here for the Roll Numbers and Lengths
Dim lastcell As Long
Dim myrow As Long

lastcell = workSheets("InspectionData").Cells(Rows.Count, "A").End(xlUp).Row

With ActiveWorkbook.workSheets("InspectionData")
..Select 'first thing to do with a With statement that occurs on a second
sheet
For myrow = 2 To lastcell
If .Cells(myrow, 1) <> "" Then
If .Cells(myrow, 1).Offset(-1, 2).Text = ComboBox28.Text And
..Cells(myrow, 1).Offset(-1, 6).Text = ComboBox1.Text And
IsNumeric(Trim(Mid(.Cells(myrow, 1), 2))) = True Then
ComboBox6.AddItem Cells(myrow, 3).Offset(2, 0) ' <======= How do
i get this result to Display what is in .Offset(2,0) to .Offset(22,0) Ie.
The range....
End If
End If

Next
End With
End Sub


Regards


Corey....


 
Reply With Quote
 
 
 
 
Corey
Guest
Posts: n/a
 
      4th Jan 2007
Also,
In relation to this POST:
Is it possible to add into the Conditions for these values to be populated
into the combobox, a step to STRIKETHROUGH the value if it was selected.
Then each subsequent record to ONLY populate the combobox list with values
that ARE NOT STRIKETHROUGH ?
Once a value has been used i do not want it to be populated in the combobox
again, yet i do not want to delete the value altogether, as i need it for
reviewing at later times.

Corey....

"Corey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The below code will list (conditionally) a value in the cell that is
> .Offset(2, 0),
> But i am trying to get it to list ALL cell values from .Offset(2, 0) to
> .Offset(22,0).
>
> How can i do this, the line highlighted is where the combobox is populated
> from:
>
> Private Sub ComboBox6_DropButtonClick()
> Application.ScreenUpdating = False
> 'Place the References in here for the Roll Numbers and Lengths
> Dim lastcell As Long
> Dim myrow As Long
>
> lastcell = workSheets("InspectionData").Cells(Rows.Count,
> "A").End(xlUp).Row
>
> With ActiveWorkbook.workSheets("InspectionData")
> .Select 'first thing to do with a With statement that occurs on a second
> sheet
> For myrow = 2 To lastcell
> If .Cells(myrow, 1) <> "" Then
> If .Cells(myrow, 1).Offset(-1, 2).Text = ComboBox28.Text And
> .Cells(myrow, 1).Offset(-1, 6).Text = ComboBox1.Text And
> IsNumeric(Trim(Mid(.Cells(myrow, 1), 2))) = True Then
> ComboBox6.AddItem Cells(myrow, 3).Offset(2, 0) ' <======= How
> do i get this result to Display what is in .Offset(2,0) to .Offset(22,0)
> Ie. The range....
> End If
> End If
>
> Next
> End With
> End Sub
>
>
> Regards
>
>
> Corey....
>



 
Reply With Quote
 
Corey
Guest
Posts: n/a
 
      5th Jan 2007
Pretty crude but solved the multiply values in a column by:
ComboBox6.AddItem Cells(myrow, 3).Offset(2, 0)
ComboBox6.AddItem Cells(myrow, 3).Offset(3, 0)
ComboBox6.AddItem Cells(myrow, 3).Offset(4, 0)
ComboBox6.AddItem Cells(myrow, 3).Offset(5, 0)
ComboBox6.AddItem Cells(myrow, 3).Offset(6 0)
....
ComboBox6.AddItem Cells(myrow, 3).Offset(22, 0)

Corey....

"Corey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The below code will list (conditionally) a value in the cell that is
> .Offset(2, 0),
> But i am trying to get it to list ALL cell values from .Offset(2, 0) to
> .Offset(22,0).
>
> How can i do this, the line highlighted is where the combobox is populated
> from:
>
> Private Sub ComboBox6_DropButtonClick()
> Application.ScreenUpdating = False
> 'Place the References in here for the Roll Numbers and Lengths
> Dim lastcell As Long
> Dim myrow As Long
>
> lastcell = workSheets("InspectionData").Cells(Rows.Count,
> "A").End(xlUp).Row
>
> With ActiveWorkbook.workSheets("InspectionData")
> .Select 'first thing to do with a With statement that occurs on a second
> sheet
> For myrow = 2 To lastcell
> If .Cells(myrow, 1) <> "" Then
> If .Cells(myrow, 1).Offset(-1, 2).Text = ComboBox28.Text And
> .Cells(myrow, 1).Offset(-1, 6).Text = ComboBox1.Text And
> IsNumeric(Trim(Mid(.Cells(myrow, 1), 2))) = True Then
> ComboBox6.AddItem Cells(myrow, 3).Offset(2, 0) ' <======= How
> do i get this result to Display what is in .Offset(2,0) to .Offset(22,0)
> Ie. The range....
> End If
> End If
>
> Next
> End With
> End Sub
>
>
> Regards
>
>
> Corey....
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combobox list to leave ONLY related values in list ?? Corey Microsoft Excel Programming 2 4th Jan 2007 09:13 PM
Combobox List to list Numerical Values ONLY in Column A is specific Sheet.... Corey Microsoft Excel Programming 5 28th Dec 2006 10:40 AM
change a vertical list of numbers to horizontal list from 1 cell =?Utf-8?B?Y2F6?= Microsoft Excel Misc 3 27th Sep 2006 12:11 PM
ComboBox in a cell in a list? Lars Netzel Microsoft VB .NET 3 25th Aug 2005 06:57 AM
How can I change the list height for a ComboBox? =?Utf-8?B?bWNjb3lu?= Microsoft VC .NET 0 6th May 2004 02:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:44 PM.