Mike Moran
New Member
- Joined
- Oct 27, 2016
- Messages
- 8
Hi-
Been all over the web today and in this forum, and so close, but no cigar.
I need to copy a row from "Master" sheet to other named sheets in one workbook, based upon CellValue Col A = sheet name. Continue down col A, copying the row to the appropriate sheet (jumping to End.xlUp.offset1 of course).
Here's one I tried (edited and edited to try and match what I'm attempting - this is the original I found):
Ideally, this will be a workbook that's updated constantly, so I don't keep adding the same data from Master to the bottom of the sheets every time I run the macro. That's probably a follow-up research issue.
Been all over the web today and in this forum, and so close, but no cigar.
I need to copy a row from "Master" sheet to other named sheets in one workbook, based upon CellValue Col A = sheet name. Continue down col A, copying the row to the appropriate sheet (jumping to End.xlUp.offset1 of course).
Here's one I tried (edited and edited to try and match what I'm attempting - this is the original I found):
Code:
Sub CopyYes() 'Static Sheets and rows ONLY
Dim c As Range
Dim j As Integer
Dim Source As Worksheet
Dim Target As Worksheet
' Change worksheet designations as needed
Set Source = ActiveWorkbook.Worksheets("Sheet1")
Set Target = ActiveWorkbook.Worksheets("Sheet2")
j = 1 ' Start copying to row 1 in target sheet
For Each c In Source.Range("A1:A1000") ' Do 1000 rows
If c = "yes" Then
Source.Rows(c.Row).Copy Target.Rows(j)
j = j + 1
End If
Next c
Ideally, this will be a workbook that's updated constantly, so I don't keep adding the same data from Master to the bottom of the sheets every time I run the macro. That's probably a follow-up research issue.