Pad Numbers With Leading ZerosJul 19, 2007
i have a header row that i want to transfer to a new spreadsheet. here is my exact setup to make it more clear:
Sheet1 - 001 PM Usage$%
Sheet2 - 022 PM Usage$%
i have dozens of these rows, and i want to set up a auto rename for the header row on sheet 2 to rename itself like this:
Dim the value from header row on Sheet 1 (001), and rename the header on Sheet 2 (022), keeping the remaining contents intact (this is important because i want to use the same function for other headers which varies).
what i am doing now is dumping the value of the first cell into a variable, but as it stands it doesnt store 001, it stores 1... stripping the zeros, which makes it more complicated.
i thought perhaps i should dim the first 3 characters in the header as a string, and rename the first 3 characters in header 2, which i think would be the most efficient, but i dont even know if that is possible.