Error 9 in Excel Code

%3CLINGO-SUB%20id%3D%22lingo-sub-2908535%22%20slang%3D%22en-US%22%3EError%209%20in%20Excel%20Code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2908535%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20version%20of%20Excel%20is%202016%20(16.0.4266.1001).%20I%20had%20found%20a%26nbsp%3B%20Macro%20in%20VBA%20for%20cutting%20and%20pasting%20data%20from%20one%20workbook%20to%20another%20since%20I%20have%20not%20been%20trained%20in%20writing%20subs%20or%20Macros.%20When%20I%26nbsp%3B%20run%20this%20VBA%20code%20I%20am%20getting%20an%20error%209%20in%20spite%20of%20the%20fact%20that%20I%20have%20checked%20and%20rechecked%20the%20Workbook%20names%20as%20well%20as%20the%20worksheet%20names%20for%20each%20Workbook.%26nbsp%3B%20Attached%20you%20will%20find%20a%20screenshot%20of%20the%20sub%20or%20Macro%20that%20I%20have%20used.%20If%20someone%20could%20please%20tell%20me%20why%20this%20is%20happening%20and%20what%20I%20can%20do.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Code%20for%20Copying%20and%20Pasting.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F322203iBE81788D6D9F938F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Code%20for%20Copying%20and%20Pasting.png%22%20alt%3D%22Code%20for%20Copying%20and%20Pasting.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Visitor

Hi

 

My version of Excel is 2016 (16.0.4266.1001). I had found a  Macro in VBA for cutting and pasting data from one workbook to another since I have not been trained in writing subs or Macros. When I  run this VBA code I am getting an error 9 in spite of the fact that I have checked and rechecked the Workbook names as well as the worksheet names for each Workbook.  Attached you will find a screenshot of the sub or Macro that I have used. If someone could please tell me why this is happening and what I can do. 

Code for Copying and Pasting.png

0 Replies