Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
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
  #2  
Old 09-17-2013, 09:06 AM
jonpackbosoxfan jonpackbosoxfan is offline Merge data from excel into word Windows 8 Merge data from excel into word Office 2010 64bit
Novice
Merge data from excel into word
 
Join Date: Sep 2013
Posts: 15
jonpackbosoxfan is on a distinguished road
Default

Okay I have one little request on this. I have been playing around with it all morning long, and I am unsure of how to accomplish this

In the report sheet, you set a total of 50 spaces. I could and have had more than 50 vendors in a given week.

If you could adjust it so that there are between 70 and 80 spaces. We are a growing market and what I am trying to accomplish here is establishing better record keeping for the future.

Thank you,

Jonathan
Reply With Quote
  #3  
Old 09-17-2013, 09:59 AM
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

Jonathan, I agree with your goal—to expand the size of the report to allow for growth, I mean. But rather than adjust it for you, I think we ought to fix it so you can understand for yourself how. Excelledsoftware may be softer-hearted, but I'm all about teaching the man to fish ... even at the risk of his going hungry a little, at first.

Let's see what he says. If he agrees with me, you'll have to do it, but one or both of us will explain how. I'd start by asking questions. For example: You say you played with it all morning. What, exactly did you try? It could be you were on the right track but just couldn't figure out how to make it work.
Reply With Quote
  #4  
Old 09-17-2013, 12:10 PM
jonpackbosoxfan jonpackbosoxfan is offline Merge data from excel into word Windows 8 Merge data from excel into word Office 2010 64bit
Novice
Merge data from excel into word
 
Join Date: Sep 2013
Posts: 15
jonpackbosoxfan is on a distinguished road
Default

Bob

Thank you. Learning would be my prefered method of getting this done.

The things that I tried to do were just first insert new rows into the sheet and then fill the formulas into this. The second thing I tried to do was to insert cells in those 4 rows and again fill the formulas into this

None of this seemed to work, because I dont understand the relation between the vba code that has been written and the y & z columns that are in the reports sheet and how all of that pulls into the actual report.

I took a visual basic class many years ago in college, but that was in 2000, and a lot has happened in the years to push all that information out of my head. Like I said about 8 years ago, I had the opportunity to work on a access database that someone else had put a ton of work into it and had a ton of underlying vba code, but this excel code seems vastly different to me, so I have a difficult time understanding it.

Thank you,


Jonathan English
Reply With Quote
Reply

Thread Tools
Display Modes


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 02:29 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