LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Copyit Macro

Hey,

I have successfully used this macro to take information from one worksheet
to another, however I need to be able to do this with multiple in the same
workbook.

In one workbook I have four master worksheets and in each master worksheet
there are names in column A which have corrosponding worksheets. I need to
have the row connected to the name in the masters copied into each
corrosponding worksheet and these names may be changed throughout the day
weekly in the master sheets.

This is the formula for the macro I used to do this with one name:

Sub copyit()
Dim MyRange, MyRange1 As Range
Sheets("LIA").Select
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set MyRange = Sheets("LIA").Range("A1:A400" & lastrow)
For Each c In MyRange
If c.Value = "ST" Then
If MyRange1 Is Nothing Then
Set MyRange1 = c.EntireRow
Else
Set MyRange1 = Union(MyRange1, c.EntireRow)
End If
End If
Next
If Not MyRange1 Is Nothing Then
MyRange1.Copy
End If

Sheets("ST").Select
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False

End Sub


'LIA' is one of the master sheets and 'ST' is the name I had it copy from
column A into the worksheet titled 'ST', I have about 13 of these names just
in the master LIA and each have their own worksheet and then 3 other master
sheets with their own names and corrosponding worksheets all in one workbook.

Can I make changes to the existing macro formula to allow for this
complicated need or do I have to make 20 different macros?

If someone could be a genius and help me sort this out I would be in awe.
--
Thanks,
Kendra
 
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 Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


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