Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default Select Case

Hi,

Actually, Sheet4.Range("C4") is legal syntax, it means the code name for the
sheet is Sheet4.

If you are trying to delete all rows in which an entry in a single column
equals the entry in C4 then you can do this very fast using the following
code:

Sub DeleteMatches()
Application.ScreenUpdating = False
Columns("A:A").Insert
Range("A1:A" & [B65536].End(xlUp).Row).Select
Selection = "=IF(RC[1]=R4C4,1,""N"")"
Selection.SpecialCells(xlCellTypeFormulas, 1).EntireRow.Delete
Columns("A:A").Delete
End Sub

In this example it is assumed that the range where the items you want to
find are located in column B

If this helps, please click the Yes button.

cheers,
Shane Devenshire

"jlclyde" wrote in message
...
I am trying to use Select Case. Sheet4.Range("C4") = 103, 113, 123,
220 and so on. I am trying to look up all of the i's in Rng and
determine if any of them are = to Sheet4.Range("C4"). this is the
code I have. It does not work as is.

Thanks,
Jay

For Each i In Rng
Select Case i
Case Sheet4.Range("C4")
i.EntireRow.Delete
End Select
Next i


 
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
Select case Hein Excel Discussion (Misc queries) 2 October 22nd 08 07:06 AM
Case Select NoodNutt Excel Worksheet Functions 7 September 21st 08 02:10 AM
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
Select Case Jeff Excel Discussion (Misc queries) 1 February 27th 06 02:56 PM
Need help on Select Case Susan Hayes Excel Worksheet Functions 1 November 3rd 04 10:25 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"