I everyone. New here and learning the ropes of VBA for excel.
I'm dealing with two obstacles in two separate spreadsheets/subroutines, which are really bugging me. I've attempted to write out the code for each subroutine, but it doesn't do what I want it to do. Maybe you guys can help?
I've attached a zip file to this post. If possible, and I say this with the greatest amount of humility possible, can you guys just proofread and amend my current code where necessary. There are still things I need to learn, but if you can correct each subroutine while preserving my initial approach or design (that is, if possible), I would be eternally grateful.
Cities.xls - This lists where a company has offices. I'm want the subroutine to 1) Sort the cities in alphabetical order (this occurs at the end of the code), 2) for each of the cities listed in "AllCities" worksheet, check whether there is a additional corresponding worksheet of the same city name, and if there isn't one, the subroutine would automatically add it, and 3) delete any worksheet of a city name that is NOT found in the listings found in the "AllCities" worksheet.
Hope that didn't sound too complicated. Check the spreadsheet to fully understand. My code will probably look juvenile and even laughable. I had problems with ranges and establishing variable objects, I guess.
HiSpenders.xls - This is an array situtation, which attempts to filter the higher spenders out of a list of people. The spreadsheet contains a list of customers and the amounts they spent in a certain period of time. I wrote a subroutine in trying capture the existing list then create two arrays of customer names and amounts spent for customers over a certain amount of money. I added an input box which asks the user to input the lowest spending limit that they want to filter out of the list. The filtered arrays are then transfered to the nearby columns.
There might be some redundant code in there - please feel free to delete as necessary. I've included comments to show my thought processes. For some reason, the arrays just never show up in the new columns. I can't figure it out.
Thank you one and all. I look forwards to your responses!
~Dcase
Bookmarks