Dear Sir/Madam,
While copying and pasting the data from one excel workbook to another, I am facing an error with selection of data range. I have written--
ActiveSheet.Range(Cells(mm, 1), Cells(LastRow1, 31)).Select
Selection.Cut
ActiveSheet.Cells(LastRow2 + 1, 1).Select
ActiveSheet.Paste
where mm, LastRow1, LastRow2 are integer variable. This code works perfect when it is used for a single workbook, but it returns error while it is tried for two workbooks. If variables are not used, direct coding like "A2:D40" is written, then it works.
This also works, Workbooks("attendanceGVK.xlsm").Worksheets("DataSheet").Range("A2:AE1000").Cut _
Workbooks(newfilenem).Worksheets("DataSheet").Range("A5000")
But, my requirement is replace this fixed range with variable
I will be obliged, if you help me inthis regards
Thanks and regards
Bivash Ghosh
+919914445701