I feel the urge to post somewhere on this forum and share my experiences working through Dave Hawley's excellent tutorial. I feel the safest place to post is in this "Have A Chat" forum since I fear breaking the rules in some fashion by posting elsewhere. This is actually the sort of topic I have the urge to chat about, even though it might appear to be a technical Excel/VBA question posted.
I am very curious about VBA for Excel, so I started first to work through the many VBA exercises. I was rather startled, at the end of Lesson 1, to see that I was invited to email my exercises to Dave Hawley. This is a pleasing personal touch. Within a day, I received answers to the exercises which contained some additional useful tips.
Here is my tip for the utter beginner (which is what I am). This morning, I realized that I should cut and paste all the commands from the first two VBA exercises, print them onto a page, and then insert the page in plastic, so that I may carry it during the day, and gradually familiarize/memorize them. I feel I shall only make progress in these studies if I become very fluent in the command syntax, so that it comes naturally to me without some great struggle to look them up each time.
I am particularly interested in learning to create user forms. Attached is my first experiment with a very simple user form which allows you to see the underlying spreadsheet activity/navigation as you issue various commands. I do hope it is O.K. if I attach my first attempt, in case it will prove useful or encouraging to other utter beginners.
I was confused regarding spaces, zero-length strings (""), and numeric tests, so I added a command button to display LEN() as a msgbox. I know in some languages, the TRIM() command, when given a string of spaces, will return one space. My experiments seem to indicate that VBA TRIM will convert a string of spaces into a zero-length space "" (which I imagine is different from the actual (NULL) value.
My goal is to increase in user form skills to the point that I can create a useful Order form for my employer. The salespersons fill out manual order forms by hand and fax them in. And they hate to use a calculator.
I already created a fairly useful Excel spreadsheet, which contains a named range of SKU# product codes, descriptions, and two different price-breaks. The SKU Part # field is restricted to validate to the range of part numbers in the named range, and has a drop down arrow to allow a sort of pick-list, if one cannot remember the exact part number. I am trying to get case weights for all the products, so that the order form will compute the weight of the order for shipping. But my feeling is that I can enhance this order spreadsheet by creating a userform, with all the necessary input fields. I feel that I can handle multipage orders if I have a field for balance forward from previous pages, and page-up page-down command buttons to allow navigation between different pages of a multi-page order. I am planning to have the form initialize some type of combo box with all the part numbers.
I should mention that we sell only abrasives (sandpaper) for the automotive industry. But we have perhaps two hundred part numbers, because each type of abrasive has a range of grits (the lower number indicating a coarser grit, and higher numbers denoting increasingly finer grits). I mention this because, obviously, if we had 10000 intentory items, then such a drop down list would perhaps be impractical. But the people who write the orders are highly specialized and familiar with the line, so they may not even need to reference the drop-down combo box.
I am trying very hard to answer myself as many questions as I run into, and I reserve posting here for only those questions where I am truly baffled.
Here is a bit of nostalgia:
As a small note of interest, I started using microcomputers around 1978. I purchased a Radioshack Model I and had possibly one of the earliest versions of Visicalc on it. My family had a business, in need of some kind of automation, so we purchased the more powerful Model III (running at a blazing 4 mhz as opposed to the .5 mhz of the Model I). After some months, I began to realize that we should have some kind of IBM clone (I always found IBM itself too expensive, when one might get a Leading Edge clone, for much less). I called the number at the back of my Visicalc manual, and asked the person who answered the phone if he might recommend something more powerful for my needs, but "like Visicalc". The man on the phone emphatically stated "NOTHING is like Visicalc." That man was Dan Brinklin, the inventor of the Visicalc spreadsheet. I happened to call in the final weeks of his business, before he sold out to Lotus (and closed with a huge profit on the books, having been "in the red" only weeks before).
In the 1970's I greately coveted a suitcase sized computer called the Osborne, which ran on the CP-M operating system.
In the 1980s, I attended a computer show in Boston at the Hines Auditorium. A gentleman behind one booth, selling books for Sofware Garden (I think), had a name tag which read "OSBORNE". I questioned him, and sure enough, he was the gentleman who had founded that portable (luggable) computer company. I felt honored and privileged to come in some brief contact with two of the early legends in computer history.
I remember, around 1978, walking into a RadioShack store, and seeing a model one with only an angular bracketed cursor blinking at the middle of the screen. I asked the salesperson what it was, and he said, "Oh, that is Visicalc." I felt quite puzzled. I couldnt for the life of me imagine what one might do with a blank screen and a large blinking cursor. I did not know what a spreadsheet was or what it could do for me. It was only when I saw friends using it for accounting purposes that I realized what it is good for and why I might want to use it.