Hi Guys,
I have to submit SIR reports for my work. Now each column header has to have a fixed length field with numeric fields I need to have leading zeros to make the fields up to a set length, 12 for example. and with Alpha fields I need to add trailing spaces to make up the length.
For example as stated above 1234 would become 000000001234, and if the alpha field need to be 10 characters then: Smith would become Smith[][][][][], where [] is a space.
Is it possible to have a VBA code that you simple select the 2nd cell in a column for example D2 (As D1 would obviously have the header and does not need altering) and then a message box asking how many characters need to be added, then whether this is leading or trailing, and only amend the the cells in the column with the selected range.
So basically whatever active cell I choose for a particular column it was add the necessary characters to complete the field requirements.
The reason I ask is that doing this manually is time consuming and laborious task. I know There would need to be at least 3 message boxes 1) to ask how many characters need adding, 2) what character this form takes either 0 or a space, 3) whether this should be leading or trailing.
I would really appreciate some VBA guru to help me out here as my VBA skills are of the bare minimum.
Thanks in advance for any help offered.
Bookmarks