I recorded a simple macro in Excel 2003 to format the columns and rows of a comma separated value report. I'm just bolding some text, widening some columns, and formatting cells to wrap text.
Some of the csv files have 8 columns, some have 9 columns.
If it is a 8 column report, I delete the 4th column (D), and continue styling the report. If it is a 9 column report, I delete the 5th column and continue styling the report.
So my first obstacle is, can the one macro be created that can determine the total number of columns, and depending on the number found, delete either column D or E?
The second obstacle is that I have certain widths I want the specific columns to be. However if I'm starting with a 9 column csv file, column A should be a different width than when column A is created from an 8 column csv report.
Is this one of those situations where giving the user two macros would be the way to go? That is, tell them, if you generate a 9 column csv file, use the 9 column macro, if you generate an 8 column csv file, use the 8 column macro. Ideally, Ideally, I'd like to provide them with one macro that can figure this out for them, but I've never touched the VG Editor so number 1, I don't know if this is possible, and number 2, if possible, how much programming will be need to pull it off. I've attached the code generated from the two macros to this message.
Any advice would be appreciated. Thanks in advance for your time.
Some of the csv files have 8 columns, some have 9 columns.
If it is a 8 column report, I delete the 4th column (D), and continue styling the report. If it is a 9 column report, I delete the 5th column and continue styling the report.
So my first obstacle is, can the one macro be created that can determine the total number of columns, and depending on the number found, delete either column D or E?
The second obstacle is that I have certain widths I want the specific columns to be. However if I'm starting with a 9 column csv file, column A should be a different width than when column A is created from an 8 column csv report.
Is this one of those situations where giving the user two macros would be the way to go? That is, tell them, if you generate a 9 column csv file, use the 9 column macro, if you generate an 8 column csv file, use the 8 column macro. Ideally, Ideally, I'd like to provide them with one macro that can figure this out for them, but I've never touched the VG Editor so number 1, I don't know if this is possible, and number 2, if possible, how much programming will be need to pull it off. I've attached the code generated from the two macros to this message.
Any advice would be appreciated. Thanks in advance for your time.