![]() |
#11
|
||||
|
||||
![]()
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.) |
|
![]() |
||||
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 |
![]() |
anju16saini | Word VBA | 1 | 03-11-2013 04:15 AM |
![]() |
WaltR | Word VBA | 8 | 05-15-2012 06:28 PM |
Macros | nore | Outlook | 0 | 06-01-2011 04:39 PM |