PC Review


Reply
Thread Tools Rate Thread

Can i remove a value from being listed with this ?

 
 
Corey
Guest
Posts: n/a
 
      18th Jan 2007
Code 1 lists a value in a sheet that in Column A.
Code lists the value that are Offset from that Value cell : Offset(2,2) -
Offset(22,2). ((using the For i To22 line)).

When a value oin the Code 2 has been displayed/used the FONT changes to
Strikethrough.
An the subsequent Strikethough value are then No longer listed in the
Combobox6(code2) list.
But i want to set the Combobox5 (Code1) to NO longer list a value IF ALL the
values between .Offset(2,2) - .Offset(22,2) are strikethough.
If there is NO values to select from in Combobox6(code2) then there is NO
point having the Initial value listed in Combobox5(code1) then is there ?

How can i a chieve this ????

Corey....



~~~~~~~~~~~~~~~~~~ Code 1 ~~~~~~~~~~~~~~~

Private Sub ComboBox5_DropButtonClick()
'Application.ScreenUpdating = False
If ComboBox5.ListCount > 0 Then Exit Sub
Dim LastCell As Long
Dim myrow As Long
On Error Resume Next
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
ComboBox5.AddItem Cells(myrow, 1)
End If
End If

Next
End With
End Sub

~~~~~~~~~ Code 2 ~~~~~~~~~~~~~~~~~~~~~~

Application.ScreenUpdating = False

If ComboBox6.ListCount > 0 Then Exit Sub
'Place the References in here for the Roll Numbers and Lengths
Dim LastCell As Long
Dim myrow As Long
On Error Resume Next
LastCell = Worksheets("InspectionData").Cells(Rows.Count,
"A").End(xlUp).Row

With ActiveWorkbook.Worksheets("InspectionData")
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 .Cells(myrow,
1).Offset(0, 0).Value = ComboBox5.Text And IsNumeric(Trim(Mid(.Cells(myrow,
1), 2))) = True Then
For i = 2 To 22
If Cells(myrow, 3).Offset(i, 0).Font.Strikethrough =
False And Cells(myrow, 3).Offset(i, 0).Value <> "" Then ' ONLY lists values
NOT Strikethrough or value=""
ComboBox6.AddItem Cells(myrow, 3).Offset(i, 0)
ComboBox6.List(ComboBox6.ListCount - 1, 1) = Cells(myrow, 3).Offset(i,
0).Address
End If
Next i
End If
End If
Next
End With
Application.ScreenUpdating = True


 
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
How to remove Windows Defender when Not listed in Add/Remove Programs List Randy Knobloch Spyware Announcements 12 27th Jun 2009 11:41 AM
can I remove patches listed in Add/Remove programs =?Utf-8?B?bXZvbGxtZXJz?= Windows XP Performance 6 3rd Apr 2007 02:27 AM
how to remove progran not listed in add/remove? david Windows XP Help 8 3rd May 2005 03:59 AM
Program I want to remove is not listed in Add/Remove Programs =?Utf-8?B?U1JWY2xjdHI=?= Windows XP General 7 9th Mar 2005 03:59 PM
remove programs not listed in add/remove list Chris Windows XP General 1 26th Jul 2003 08:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:49 AM.