PDA

View Full Version : Removing selected regions, columns and using Vlookup



alanmonty
09-09-2008, 06:58 AM
Good Morning Everyone,








I have a xls file I'm exporting from SAP that contains a lot of info i dont need and is missing some info i do need. What ive pasted below is an example of what it will look like simplified. What I need to do is right off the bat delete all regions that don't have an "F" in front of their first cell. So this would delete everything associated with "34" (that whole 3x3 array) but would keep all the F23 stuff (the 3x2 array) in this example. Then there are certain columns that i do not need. The column that just has the "EA" after the number 190, 230, and 400 is not needed so I would like to automatically delete them. Finally I would like to add in a column which will populate the cells to the right of the numbers 190, 230, and 400 with a vlookup function.





As i said this is a simplified version, ill take whatever help i can get and will make it specific to the huge files ill be doing. I know some basic VBA programming and know how to do the vlookup stuff, i just dont know how to code into a macro to tell it to only do it next to cells that have values. Thanks in advance for any help.





alan
















F23 Prod 23




9/8/2008
190
EA





34 Prod 34




9/8/2008
230
EA
9/8/2008
400
EA♦ :dunno

alanmonty
09-09-2008, 07:02 AM
Well i already see this didnt go well so here is a retry of that little array.



F23_____ Prod 23
_________9/8/08____ 190______ EA

34______ Prod 34
_________9/8/08____ 230______ EA
_________9/8/08____ 400______ EA

RonMcK
09-09-2008, 10:17 AM
For future reference, you can edit your original post if/when you find it doesn't look the way you want it or you find errors that you want to correct.

In addition, before you paste in code for our review, please click the 'VBA' button (loads vba tags into your msg) and, then, paste your formated code between the vba tags; doing this will preserve the formating of your code.

Cheers,