I'm recording a macro to convert a text file into a csv and save it to the desktop ready for importing into another program. I'm nearly there with it but am stuck on one bit.
First, we are converting the file to csv. Column A is the order number and looks like 111-1111111-111111. I want to remove the first 12 characters
so have applied the formula =right(a1,len(a1)-12) to an empty cell on the right. Then, this is pasted back to a1 as a value only so we get the desired result. The formula column is then deleted.
Now, the problem is that the file has a varying amount of rows every time the macro is used. If I apply the formula to say, 200 rows, I get a load of cells with #VALUE in them where there there was nothing in a1.
So,is there a qualifier to apply the formula only if A1 has something in it? Or can I somehow delete any cell which has #VALUE in it in some way?
First, we are converting the file to csv. Column A is the order number and looks like 111-1111111-111111. I want to remove the first 12 characters
so have applied the formula =right(a1,len(a1)-12) to an empty cell on the right. Then, this is pasted back to a1 as a value only so we get the desired result. The formula column is then deleted.
Now, the problem is that the file has a varying amount of rows every time the macro is used. If I apply the formula to say, 200 rows, I get a load of cells with #VALUE in them where there there was nothing in a1.
So,is there a qualifier to apply the formula only if A1 has something in it? Or can I somehow delete any cell which has #VALUE in it in some way?
Comment