View Single Post
 
Old 10-16-2013, 01:31 PM
BobBridges's Avatar
BobBridges BobBridges is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

That's a good start, though it may not sound like much to you. Now, one of my failings is also a strength: I like to explain things, perhaps too much. But in this venue, long explanations will just bore you, especially when I don't know how much you know and may try to explain something at length that's old had to you. So I'll try going fast—but you really must ask about everything you're not sure about, because otherwise I'll end up skipping over something you need to know.

Your import macro, as I see it, will have to 1) find the text file, either with or without the user's help—we'll decide that later—2) open and read it, and 3) parse out the text for each line and place the values into a worksheet. Maybe it'll have to clean out the old worksheet, too, or maybe create a new one; that's a detail that I'll leave up to you. Exporting the data to a text file can also be done in VBA, but maybe it won't be necessary.

I gotta run out this evening, and I'm late now, so let me just assign a trivial exercise as homework: Write a VBA program, and run it, that generates some simply message, such as "Hi, there!" (or whatever else you like). If you already know how, great. If you don't, here's how it would look if I did it:
Code:
Sub Main(0)
  MsgBox "Hi, there.  Bob Bridges is an absolute genius!"
  End Sub
Try that (or something more scurrilous, if that'll help challenge your creative juices) and let me know whether you run into trouble. We'll add parts that do what you actually want to do, one at a time, starting when I get back.
Reply With Quote