PC Review


Reply
Thread Tools Rate Thread

Combo Change works in 2K not 2003

 
 
Chad
Guest
Posts: n/a
 
      14th Jul 2008
Hi All

The following code works well in XL 2K but not 2003. I have a
combobox with 7 categories. Test 1 –5, “All” and “Show 123”. Does
anyone have any idea how I might produce the same code in XL 2003.

Thanks in advance.
Chad

Private Sub ComboBox1_Change()
Dim lw As Long

Application.ScreenUpdating = False
Range("A7:A100").EntireRow.Hidden = False
lw = Range("A" & Rows.Count).End(xlUp).Row

' If Range(
For i = lw To 2 Step -1
If Range("A" & i).Value = ComboBox1.Value Then
Range("A" & i).EntireRow.Hidden = True
ElseIf ComboBox1.Value = "All" Then
Range("A7:A100").EntireRow.Hidden = False

ElseIf ComboBox1.Value = "Show 123" Then
If Range("A" & i).Value = "Test4" Or _
Range("A" & i).Value = "Test5" Then
Range("A" & i).EntireRow.Hidden = True
End If
End If

Next i
Calculate
Application.ScreenUpdating = True

End Sub
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      14th Jul 2008
I don't see any reason why it would not work in xl2003. What indications are
you getting? Error message?

"Chad" wrote:

> Hi All
>
> The following code works well in XL 2K but not 2003. I have a
> combobox with 7 categories. Test 1 –5, “All” and “Show 123”. Does
> anyone have any idea how I might produce the same code in XL 2003.
>
> Thanks in advance.
> Chad
>
> Private Sub ComboBox1_Change()
> Dim lw As Long
>
> Application.ScreenUpdating = False
> Range("A7:A100").EntireRow.Hidden = False
> lw = Range("A" & Rows.Count).End(xlUp).Row
>
> ' If Range(
> For i = lw To 2 Step -1
> If Range("A" & i).Value = ComboBox1.Value Then
> Range("A" & i).EntireRow.Hidden = True
> ElseIf ComboBox1.Value = "All" Then
> Range("A7:A100").EntireRow.Hidden = False
>
> ElseIf ComboBox1.Value = "Show 123" Then
> If Range("A" & i).Value = "Test4" Or _
> Range("A" & i).Value = "Test5" Then
> Range("A" & i).EntireRow.Hidden = True
> End If
> End If
>
> Next i
> Calculate
> Application.ScreenUpdating = True
>
> End Sub
>

 
Reply With Quote
 
Chad
Guest
Posts: n/a
 
      14th Jul 2008
Hi Thanks for the response. This line

Range("A7:A100").EntireRow.Hidden = False

If I click on the yellow error line for a definition I get the
perfectly helpful message "Identifier under curser not recognised".
It has confused me no end as my code works wonderfully in 2k, but I
put it on the users machine and it fails in 03.

Chad



 
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
Combo box contents doesn't change when filtering combo box is chan Joe M. Microsoft Access 2 17th Nov 2009 10:38 PM
Using combo box to change color of tabs (xl 2003) Kragelund Microsoft Excel Programming 3 1st Oct 2008 02:03 PM
Combo Box vba that works like Forms Menu combo box Hector Fernandez Microsoft Excel Programming 4 12th Dec 2006 08:30 PM
Can Office 2003 retrieve works documents older than works ver 6? =?Utf-8?B?b25seW1l?= Microsoft Word Document Management 1 20th Nov 2005 06:14 AM
Combo Box works in 2002 but not 2003 Pat Pawlowski Microsoft Access Form Coding 0 8th Jan 2004 01:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:53 PM.