hello!
i have been trying to copy formatting from worksheet A in one workbook to worksheet B in a different workbook using a macro. Following is the script:
Sub oldnewdif()
'to find the difference between two sheets
Range("A1:AH500").Formula = _
"=IF(ISBLANK([WB1.xls]Sources!RC),"""",IF(ISTEXT([WB1.xls]Sources!RC),T([WB1.xls]Sources!RC),[WB1.xls]Sources!RC-[WB2.xls]Sources!RC))"
Windows("WB1.xls.xls").Activate
Cells.Select
Range("A1:AH500").Activate
Selection.Copy
Windows("New Microsoft Excel Worksheet.xls").Activate
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Windows("WB1.xls.xls").Activate
Windows("New Microsoft Excel Worksheet.xls").Activate
End Sub
On running it there is always an error that says "subscript out of range". Could someone please tell me how to resolve this?
Thanks
Shailee
i have been trying to copy formatting from worksheet A in one workbook to worksheet B in a different workbook using a macro. Following is the script:
Sub oldnewdif()
'to find the difference between two sheets
Range("A1:AH500").Formula = _
"=IF(ISBLANK([WB1.xls]Sources!RC),"""",IF(ISTEXT([WB1.xls]Sources!RC),T([WB1.xls]Sources!RC),[WB1.xls]Sources!RC-[WB2.xls]Sources!RC))"
Windows("WB1.xls.xls").Activate
Cells.Select
Range("A1:AH500").Activate
Selection.Copy
Windows("New Microsoft Excel Worksheet.xls").Activate
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Windows("WB1.xls.xls").Activate
Windows("New Microsoft Excel Worksheet.xls").Activate
End Sub
On running it there is always an error that says "subscript out of range". Could someone please tell me how to resolve this?
Thanks
Shailee