LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Repeating macro procedure on several worksheets


I have written the following macro which works fine but my problem i
how I can use this same macro on evry Sheet in my workbook.
The macro simply selects rows which have a certain cell value in colum
N and the pastes the entire row elsewhere. In my workbook there are 1
worksheets, I need to do this exact operation for 13 of thes
worksheets so is there a way of changing the macro so that it perform
the operation on these 13 worksheets.
Or can i change the range to help this.
Any help would be much apprecaited,


Sub MoTStrikeRate()
Dim rng As Range, cell As Range, sel As Range
Set rng = Intersect(Range("N:N"), ActiveSheet.UsedRange)
For Each cell In rng
If (cell.Value) = "Y" _
Or (cell.Value) = "y" Then
If sel Is Nothing Then
Set sel = cell
Else: Set sel = Union(sel, cell)
End If
End If
Next
On Error Resume Next
sel.EntireRow.Select
Application.CutCopyMode = False
Selection.Copy
Range("A210").Select
ActiveSheet.Paste
End Sub


Many thanks,
Andre

--
Shandy72
-----------------------------------------------------------------------
Shandy720's Profile: http://www.excelforum.com/member.php...fo&userid=2623
View this thread: http://www.excelforum.com/showthread.php?threadid=47474

 
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
I am repeating the same procedure and cpt codes Chinadoll777 Excel Worksheet Functions 1 December 30th 09 07:56 PM
How do I display repeating text between worksheets only once on ta Paul New Users to Excel 1 August 11th 09 01:23 PM
Text repeating on multiple worksheets Angie P Excel Discussion (Misc queries) 3 December 22nd 05 01:28 AM
Deleting worksheets in a procedure Al[_12_] Excel Programming 3 November 3rd 03 11:56 AM


All times are GMT +1. The time now is 11:17 PM.

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"