Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am assuming that each worksheet has max 52 columns and 100 rows ( you can modify the code according to your need ) and you have 10 sheets in your workbook and you want to delete row 20 on every sheet that has "Vanessa" in any cell in those 52 columns and 100 rows. Your macro could be Sub vanessa() For i = 1 To 10 ' 10 is number of sheets Set rng = Worksheets(i).Range("A1:AZ100") ' range we want to search With rng Set c = .Find("vanessa") 'search is not case sensitive If c Is Nothing Then 'do nothing Else ..Rows(20).Delete End If End With Next End Sub The search will not distinguish between Vanessa or vanessa if you want to match case also then change to set c=.Find("Vanessa", MatchCase:=True) A V Veerkar -- avveerkar ------------------------------------------------------------------------ avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338 View this thread: http://www.excelforum.com/showthread...hreadid=504780 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro enabled excel worksheet running very slow. | Excel Discussion (Misc queries) | |||
How to remove macro from perticular excel? | Excel Discussion (Misc queries) | |||
How do i set up blink a perticular cell? | Excel Discussion (Misc queries) | |||
Macro running against hidden worksheet | Excel Discussion (Misc queries) | |||
Running of Worksheet Change Macro breaks undo functionality. | Excel Discussion (Misc queries) |