Hi All,
Been reading bits and pieces around here (and various other sites) as I get myself back up to speed in VBA scripting (it's been several months since I've had to do anything and I'm pretty rusty already).
Was hoping someone would be kind enough to assist me in refining down my code to be shorter and more to the point?
Specifically, I would really like help in replacing my cheatsheet (Sheet19 in the code) I used to replace the Column Number with a subsequent Column Letter (Using Function: "ColLetterFromNo"... I think R1C1 might be an option for me??) and figuring out a way to further variable-ize the code so that it will eventually work nearly automatically. Also, I've been having the most difficult time getting the clear portion of the macro to work on the Import sheet, so I resorted to having the macro use the CountA WorksheetFunction again (there's a better way, I am certain of this, but I can't seem to get it just right...) to make it work.
The point of this sheet is to check the Headers on my "Import" Sheet, loop through the subsequent sheets and pair up those Headers with that of the current sheet it loops into, determine the final row in the sheet (Note: Final Row of a specific column, I maintain an arrayed ID # throughout the entire sheet, which prohibits normal last row lookups) and then copy those columns to the Import Sheet. As it continues through, it appends the data rather than replaces as well. Eventually I will be making this entire sheet copy its data to another workbook to perform a SQL database update.
I've spent about 2 days getting to this point.
Notes: I have had to comment out anything in the 'E' category as I have not set up my data sheet to handle everything in that column appropriately yet. I cannot share the workbook (maybe I can rig up a small test if needed) but I will be handling up to a couple thousand rows per sheet potentially and the column layout of each sheet is vastly different, fortunately I am only pulling the similar data from each sheet to my "Import" worksheet which makes it a little simpler.
Much appreciation to whomever is willing to lend me a hand here.
LW
Bookmarks