Hi,
Following my thread Using Excel VBA to rename files in a folder asking how to rename files in a folder using VBA, I am trying to do something similar but the procedure is more complicated.
In the other scenario I simply needed to attach the same prefix to the first 11 characters of the file name. In this case, however, the file name starts with a number which can be any size up to five digits, preceded by an underscore. I need to attach the same prefix "abcde123 " to the number to get the renamed file.
In regular Excel terms, the new file name would be created by the formula ="abcde123 "&left(a1, find("_",a1)-1). How would I use VBA to change the file name (sFileName as in the other thread) the same way?
Following my thread Using Excel VBA to rename files in a folder asking how to rename files in a folder using VBA, I am trying to do something similar but the procedure is more complicated.
In the other scenario I simply needed to attach the same prefix to the first 11 characters of the file name. In this case, however, the file name starts with a number which can be any size up to five digits, preceded by an underscore. I need to attach the same prefix "abcde123 " to the number to get the renamed file.
In regular Excel terms, the new file name would be created by the formula ="abcde123 "&left(a1, find("_",a1)-1). How would I use VBA to change the file name (sFileName as in the other thread) the same way?