VBA-Excel: Create or Add Worksheets at the Run time.VBA-Excel: Add Worksheets For All The Given Dates Except Weekends and Copy The Common Template In Each Worksheet.VBA-Excel: Create worksheets with Names in Specific Format/Pattern.VBA-Excel: Read XML by Looping through Nodes.
Now this code will run fine and paste the A1 cell data from sheet1 to sheet3.Įnter your email address to subscribe to this blog and receive notifications of new posts by email.
Worksheets("Sheet3").Select ' Activate the sheet3 If you run this procedure, you will, get “ Run-time error ‘1004’: Application defined or object defined error”Īll you need to do is, just activate the sheet3 before selecting the cell from it and pasting the data Sub CopyPasteData() Select works only with actives worksheets, if you use Select on cells before activating the respective sheet, the select method will fail and you will get “ Run-time error ‘1004’: Application defined or object defined error” Select is used mostly in the cases of copy-paste operation where you have to tell the compiler specifically that from which cell it has to copy the data and in which cell it needs to be pasted. You can put or enter values in cells with/without selecting the cells. You can Select a cells or cells for performing many activities like putting some value in cell or doing formatting or copy-paste the data.