Greetings again,
I am receiving an error "wrong number of arguments or invalid property assignment" on the line below:
Also, some of the variables I am using included in this line:
My intention with this chunk is to loop through dates on one worksheet to test whether or not the same date is included on another sheet by a similar name in a different workbook. If there are matching dates then I would like to copy the range from the MAIN workbook using the current fnd range variable and paste it on another sheet.
Thanks for all your help and input!
I am receiving an error "wrong number of arguments or invalid property assignment" on the line below:
Code:
Set Fnd = MAIN.Worksheets("M_" & AC).Range.Find(What:=COM.Worksheets(AC).Cells(j, 1).Value, After:=MAIN.Worksheets("M_" & AC).Cells(1, 1), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext)
Also, some of the variables I am using included in this line:
Code:
Dim Fnd As Range
Set COM = Workbooks("COMM_COMBINED.xls")
Set MAIN = Workbooks("COMM_LD_MAIN.xls")
Code:
j = 3
For Each ws In COM.Worksheets
AC = ws.Name
Do While COM.Worksheets(AC).Cells(j, 1) <> ""
Set Fnd = MAIN.Worksheets("M_" & AC).Range.Find(What:=COM.Worksheets(AC).Cells(j, 1).Value, After:=MAIN.Worksheets("M_" & AC).Cells(1, 1), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext)
If Not Fnd Is Nothing Then
MAIN.Worksheets("M_" & AC).Range(Fnd, Fnd.End(xlToRight)).Copy
COM.Worksheets(AC).Activate
Cells(j, 1).Select
Selection.End(xlToRight).Offset(0, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End If
j = j + 1
Loop
COM.Worksheets(AC).Activate
Cells(j, 1).Select
b = Selection.End(xlToRight).Offset(0, 1).Column
Next ws
My intention with this chunk is to loop through dates on one worksheet to test whether or not the same date is included on another sheet by a similar name in a different workbook. If there are matching dates then I would like to copy the range from the MAIN workbook using the current fnd range variable and paste it on another sheet.
Thanks for all your help and input!