LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Running macro on the perticular worksheet only


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
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
macro enabled excel worksheet running very slow. Bill R Excel Discussion (Misc queries) 1 May 21st 09 09:57 PM
How to remove macro from perticular excel? Denish Excel Discussion (Misc queries) 2 April 20th 09 12:44 PM
How do i set up blink a perticular cell? aziz Excel Discussion (Misc queries) 1 June 16th 08 03:33 PM
Macro running against hidden worksheet George Excel Discussion (Misc queries) 1 July 23rd 07 09:42 PM
Running of Worksheet Change Macro breaks undo functionality. Rob Manger Excel Discussion (Misc queries) 1 April 6th 06 04:04 AM


All times are GMT +1. The time now is 08:29 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"