Deleting a file in VBA

.) Check here. Basically do this: I’ll leave it to you to figure out the various error handling needed but these are among the error handling things I’d be considering: Check for an empty string being passed. Check for a string containing characters illegal in a file name/path 2.) How To Delete a File. Look at this. Basically … Read more

Does VBA contain a comment block syntax?

Although there isn’t a syntax, you can still get close by using the built-in block comment buttons: If you’re not viewing the Edit toolbar already, right-click on the toolbar and enable the Edit toolbar: Then, select a block of code and hit the “Comment Block” button; or if it’s already commented out, use the “Uncomment … Read more

What exactly is the function of Application.CutCopyMode property in Excel

By referring this(http://www.excelforum.com/excel-programming-vba-macros/867665-application-cutcopymode-false.html) link the answer is as below: Application.CutCopyMode=False is seen in macro recorder-generated code when you do a copy/cut cells and paste . The macro recorder does the copy/cut and paste in separate statements and uses the clipboard as an intermediate buffer. I think Application.CutCopyMode = False clears the clipboard. Without that line you will get … Read more

What is the function of FormulaR1C1?

FormulaR1C1 has the same behavior as Formula, only using R1C1 style annotation, instead of A1 annotation. In A1 annotation you would use: In R1C1 you would use: It doesn’t act upon row 1 column 1, it acts upon the targeted cell or range. Column 1 is the same as column A, so R4C1 is the … Read more

lists and arrays in VBA

You will have to change some of your data types but the basics of what you just posted could be converted to something similar to this given the data types I used may not be accurate. Collections cannot be sorted so if you need to sort data you will probably want to use an array. … Read more