Programatically Naming Worksheets (using concatenated values)
Hi Susan,
Your code works very well muchas gracias! Ok, here it goes.....
Some Issues:
1. Using your test code:
Excel doesn't report the correct amount of cells that have been coloured.
Regardless of how many cells are left before the end of the list and
subsequently filled in yellow after enacting the macro, there are still "15
names added" reported in the message box. For example, let's say that 1 extra
name has been added in column C, and user chooses this last row to take on a
yellow fill, the message will still read that "15 names have been added"
(when in fact only 1 name has been highlighted in yellow). Of course there is
still the issue of the "LastCell" being changed to reflect the next line
somehow, and this likely causes related problems....
2. Substituting my code for your test code:
Excel still doesn't like the line: ActiveSheet.Name = cell.Value & "(" &
cell.Offset(0,1).Value & ")"
When the macro is enacted, Excel doesn't stop at 15 names (likely due to the
"LastCell" issue above), and instead craps out pointing to the
"ActiveSheet.Name=....." line above. When I take out this concatenated
feature, the macro still runs until but stops when it runs into our "Copy
After" issue reported to be a bug in Excel. I suspect that once this
"LastCell" issue is resolved and Excel goes to the next cell, the
concatenated feature will not cause Excel to trip (and neither will the "Copy
After" issue).
I'll keep on trying.... thanks to you am much closer to resolving this
issue. How can I use the Excel "hidden worksheet value" to tell the macro on
which row to
start? Hope I'm not overstaying my welcome on this issue... 'bout those
chocolates....
--
Kent Lysell
Financial Consultant
Ottawa, Ontario
(613) 907-1211
"Susan" wrote:
no beer; how 'bout chocolate? :)
ha ha
let me know if it works, please?
thanks
susan
On Mar 13, 11:54 am, klysell .(donotspam) wrote:
Hi Susan and Pete,
If you guys are ever in Ottawa, Ontario, I'll gladly buy you beer :) I'm in
the process of implementing Susan's code, and I can't thank you enough for
your help. Pete, I've known for some time that there would be problems with
respect to data validation when the user inputs an employee name or agreement
no. An illegal character - i.e. "/", ":" - would generate an error when used
in a worksheet name. Is there a catch-all fix that I could implement? Perhaps
I'll wait until I get this stage of the puzzle solved and then I'll tackle
the data validation issue. Thanks Susan and Pete!
--
Kent Lysell
Financial Consultant
Ottawa, Ontario
W: (613) 943-9098
E-mail:
"Susan" wrote:
pete - oh. well, that's kent's problem. :) i'm not handling the
concatenated names, just the looping & userform. ha ha
|