View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default Compare Column to Inbput Box Variable

It's difficult to give you "the" answer without knowing how you want to
handle matches. You say you can't use AutoFilter, so we'll just assume you
want matched cells 'noticed' for the moment. This code physically moves cell
to cell down the column - there are definitely more efficient, faster ways to
do this with Range objects, but since this is 2nd time out for you <g.

Dim lastRow as Long

'you get your TestClass value as before here

lastRow = Range("L" & Rows.Count).End(xlUp).Row
'if using Excel 2007, substitute:
lastRow = Range("L" & Rows.CountLarge).End(xlUp).Row
Range("L1").Select
Do Until ActiveCell.Row lastRow
If ActiveCell.Value = TestClass Then
'code to process matched data here
End If
ActiveCell.Offset(1, 0).Activate ' move to next row
Loop


"GrandMaMa" wrote:

User's Group

This is only the second time I have ever worked with Excel so please have
patience.

I need to enter Filtering Criteria from an Input Box.

Then match the contents of that variable to Column L (Will always be Column L)

Because of what I eventually have to do I cannot use Autofilter.

TestClass = InputBox("Enter ACT, International, S.A.T. or TAKS
Classification")

? = What is the Format(Syntax) to compare the contents of TestClass to
Column L.

There will be eventually more code, I have to convert from another software
application (That I have little knowledge of) to Excel.

Thanks to all of ya' for assistance

Granny