Hello again,
I'm relatively new to VBA for Excel, and I've been learning as I go along. I don't know all the methods available to me, and I don't know which are more effecient than others. I was hoping somebody could take a look at the code below and let me know if anything could be significantly improved. I know it's a mess; it looks like the originator just used excel's built-in macro recording feature and added some basic looping code. I've added to it as my job has necessitated, but it's just become sloppier and unwieldy.
The macro's basically a clean-up script to turn our company software's garbled reports into something readable by humans. The reports come in two flavors, Detail and Profile. The main difference between them is the order of the data columns, and in which column the usable data begins. What I'm calling "usable data" begins with a cell containing either " Master :" (in a Profile report) or "Master - " (in a Detail report). The actual usable rows of data may begin in column A or J (in the case of a Detail report), or column A or G in the case of a Profile report. (It's possible that a Profile report's data could start in column I, but I haven't seen this since we stopped using an older version of our software, so I'll assume it won't happen in the future.)
This macro moves the start of the data in each row from whatever column it's currently in, to column J. Sometimes a row contains no usable data and is deleted, shifting up the rows underneath. Once all data is aligned in columns, the columns are shifted around a bit to put them in the desired order.
There's no real reason, as far as I can tell, that it's moved to column J... this is just how the macro worked when I started updating it. If you think data should first be moved to column A, that's fine, I just haven't re-written it that way so that I wouldn't have to re-write the bits that shuffle the columns later on.
I don't expect anybody to re-write any portions or anything, but a simple "Try using this method instead of that" would be greatly appreciated.
Thank you!
Bookmarks