Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 06-16-2014, 10:23 AM
BobBridges's Avatar
BobBridges BobBridges is offline NEWB to Macros - formatting exports Windows 7 64bit NEWB to Macros - formatting exports Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Don't you just utterly hate that? I'm a writer, myself, and when either I or my software sends my blood, sweat and tears to the planet Zembar (as Dave Barry once claimed after they installed word processors at the Miami Herald) I'm so heartsick I can barely work up the enthusiasm to start over. And I'm sorry to tell you that although I love programming, programming is writing; the same discouragement applies there, when you accidentally delete something you just spent all morning writing. (So learn to keep copies...though even if you do, you're bound to not, once in a while.)

Yes, we can easily (relatively easily) get your program to locate the last row in the worksheet and process all the rows from 2 to that, instead of to something hard-coded like 264. Let's do that next, and add the extra column third. First we'll fix the error.

The error is my fault. TintAndShade and ThemeColor are properties not of the Cell object directly but of some sub-property; I think Cell.Interior is involved, but there may be more. The original program had it right, and I over-simplified. Try changing it to ce.Interior.ThemeColor and ce.Interior.TintAndShade (adding the ".Interior" part to both) and see whether that fixes it. If not, take a look at the original code Excel recorded for you, and maybe what you need to change will be obvious from that. (Sure, I could look for myself; but what would you learn from that?)

And I should introduce you to some other features of the VBA Editor, too, so that when I or someone else makes a similar bone-headed goof like that, you won't be helpless until you can get someone to answer you: There are ways you can figure it out for yourself. (I'm a teach-a-man-to-fish sort, you see.)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting contents after Tab of continuous lines or formatting specific area of word pawii Word 1 05-12-2014 05:24 AM
macros stebrownsword Word VBA 0 08-28-2013 01:16 AM
NEWB to Macros - formatting exports How to do Formatting Using Macros anju16saini Word VBA 1 03-11-2013 04:15 AM
NEWB to Macros - formatting exports Formatting with macros WaltR Word VBA 8 05-15-2012 06:28 PM
Macros nore Outlook 0 06-01-2011 04:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:30 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