Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 09-16-2013, 09:23 PM
BobBridges's Avatar
BobBridges BobBridges is offline Merge data from excel into word Windows 7 64bit Merge data from excel into word Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Quote:
I am aware of debugging and how to do it.
Yeah, that part was for Jonathan. It's his program, after all, in the final analysis—he's the one who has to make it work. I hope he'll try it, because (as you already know) the debugging features in the VBA editor are a lot better than writing a lot of of MsgBox calls to figure out what's going on.

Quote:
I have only been vba coding for about 2 months now and have a lot to learn still.
Believe me, I was 'way behind you when I first started on VBA. I'd been doing traditional coding for a long time, and I knew Basic well enough; I just didn't understand how object-oriented programming was different, and it caused me no end of frustration at first. Writing my first simple object cleared up a lot of my confusion; it wasn't necessary for the task I was trying to write, strictly speaking, but it helped me understand what I hadn't before about the difference between a function and a "method".

Quote:
The FOR statement is definitely not the best it could be how would you go about doing a DO Until when a lot of the cells are already blank?
I don't have anything against For statements—it's probably what I'd go to first, in this case—but rather than hard-code the last row ("For X = 1 To 104"), I'd be willing to take a lot of trouble to get the program to figure out for itself what the last row is. That's because the program is sure to be run many times between now and Whenever, and you don't want to have to change it repeatedly—and, likely as not, have to change it when you're already busy and can't spare the time, or (even worse) not realize it has to be changed, and then wonder why your data isn't right. So I'd tell the program to go looking for the last line, and use that in the loop.

As for the loop itself, I probably would do it pretty much the same way you did. Oh, I have a preference for changing the output row before the write instead of after, and I never name variables X any more (because of a mishap in another language entirely; but those are more programming style than The One Right Way to do something; any programmer will tell you there are lots and lots of ways to skin every cat you ever saw.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge data from excel into word data from Excel into Word table ragesz Word Tables 1 09-29-2013 06:14 PM
converting a word document to a data file for mail merge drsuis Mail Merge 4 02-21-2013 03:34 PM
Merge data from excel into word How can I revise Excel data source in merge? navysalad Mail Merge 6 01-07-2012 06:50 PM
Merge data from excel into word Wine List, Data Merge - Excel to Publisher - Or other suggestions? daym Publisher 2 05-01-2011 03:45 AM
How do I set up the fields in mail merge word 07 from my data base mbcrabber Mail Merge 4 06-06-2010 01:25 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft