I need help in copying cells (with both data and comments) in excel workbook to another excel workbook. I am trying but it is only copying data and not copying comments with it.
Please help me in this..
use the paste special method to copy the data and its comments/formula etc.,
I tried but it didn't work...it is copying one workbook to another workbook as image file..please let me know if you have another suggestion.
try below code:
[ QUOTE ]
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook1= objExcel.Workbooks.Open("C:\Test1.xlsx")
Set objWorkbook2= objExcel.Workbooks.Open("C:\Test2.xlsx")
objWorkbook2.Worksheets("Sheet1").Range("A1").Past eSpecial Paste =xlValues
[/ QUOTE ]
Try and fail, but don't fail to try
Thanks KrisrisK. I think the code you have used will also work with Paste function (no need to use Paste Special function) because you have not created 2 separate excel instances.
Can you give me the same code with Paste function instead of Paste Special function so that I can check that?