If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#21
|
|||
|
|||
Use Named Range instead?
The loop I want wouldn't cycle through the whole list (all the patients
enrolled in our program) in AC, but only the names I select (my caseload) from AC and apply a range name (myList) to. For each name in my caseload (myList), PrintMine() would find only those names in A and print the pages for only those patients. Example: ColAC Name1 through Name100 (names only, no blanks, sorted alphabetically) I select Name3, Name7, Name8, Name15, and Name21 (the discontiguous range--my caseload) and apply a range name (myList) to that selection ColA Name1 followed by a list of classes Name2 followed by a list of classes Name3 followed by a list of classes and so on through Name100 Each patient's page is set via horizontal page breaks PrintMine() would loop through myList, finding each of those patients in ColA and printing that patient's page. Sorry this has been such a confusing exercise. I know you can't see my screen. -- David Dave Peterson wrote I was confused by this line: Column AC is the one with names only, no blanks, sorted alphabetically when added via an AddPatient() routine. There was a disconnect between the no blanks in one of your posts and the discontiguous range in others. So is there anything else in Column AC except for each name and empty cells? If no, you could still pickup that range and loop through them: dim myListRange as range dim myCell as range with whateversheet set mylistrange = .range("ac1",.cells(.rows.count,"AC").end(xlup) end with for each mycell in mylistrange.cells if isempty(mycell.value) then 'do nothing else 'do the find end if next mycell |
#22
|
|||
|
|||
Use Named Range instead?
Is there anything on that row that indicates that the name in column AC should
be used? You could check for that indicator, too. If only you (as a human) know what's in that list, maybe you could use another workbook to create the list and cycle though that. It might be easier than fiddling with a range name that changes. David wrote: The loop I want wouldn't cycle through the whole list (all the patients enrolled in our program) in AC, but only the names I select (my caseload) from AC and apply a range name (myList) to. For each name in my caseload (myList), PrintMine() would find only those names in A and print the pages for only those patients. Example: ColAC Name1 through Name100 (names only, no blanks, sorted alphabetically) I select Name3, Name7, Name8, Name15, and Name21 (the discontiguous range--my caseload) and apply a range name (myList) to that selection ColA Name1 followed by a list of classes Name2 followed by a list of classes Name3 followed by a list of classes and so on through Name100 Each patient's page is set via horizontal page breaks PrintMine() would loop through myList, finding each of those patients in ColA and printing that patient's page. Sorry this has been such a confusing exercise. I know you can't see my screen. -- David Dave Peterson wrote I was confused by this line: Column AC is the one with names only, no blanks, sorted alphabetically when added via an AddPatient() routine. There was a disconnect between the no blanks in one of your posts and the discontiguous range in others. So is there anything else in Column AC except for each name and empty cells? If no, you could still pickup that range and loop through them: dim myListRange as range dim myCell as range with whateversheet set mylistrange = .range("ac1",.cells(.rows.count,"AC").end(xlup) end with for each mycell in mylistrange.cells if isempty(mycell.value) then 'do nothing else 'do the find end if next mycell -- Dave Peterson |
#23
|
|||
|
|||
Use Named Range instead?
Dave Peterson wrote
Is there anything on that row that indicates that the name in column AC should be used? Nope If only you (as a human) know what's in that list, maybe you could use another workbook to create the list and cycle though that. It might be easier than fiddling with a range name that changes. I think I'd rather opt to copy my caseload names from AC to another column, Hide it, Name and cycle through that range. I could add/remove names to/from that list manually -- David |
#24
|
|||
|
|||
Use Named Range instead?
I'd even put it on another worksheet--then inserting/deleting rows would be
safer. But if you don't have enough control over that workbook, you can still have your macro use a completely different workbook, too. David wrote: Dave Peterson wrote Is there anything on that row that indicates that the name in column AC should be used? Nope If only you (as a human) know what's in that list, maybe you could use another workbook to create the list and cycle though that. It might be easier than fiddling with a range name that changes. I think I'd rather opt to copy my caseload names from AC to another column, Hide it, Name and cycle through that range. I could add/remove names to/from that list manually -- David -- Dave Peterson |
#25
|
|||
|
|||
Use Named Range instead?
I just realized adding/removing classes would indeed disturb my list.
Thanks for making me think. I really appreciate all the time and effort you've expended on my behalf. -- David Dave Peterson wrote I'd even put it on another worksheet--then inserting/deleting rows would be safer. But if you don't have enough control over that workbook, you can still have your macro use a completely different workbook, too. |
#26
|
|||
|
|||
Use Named Range instead?
Good luck on the project.
David wrote: I just realized adding/removing classes would indeed disturb my list. Thanks for making me think. I really appreciate all the time and effort you've expended on my behalf. -- David Dave Peterson wrote I'd even put it on another worksheet--then inserting/deleting rows would be safer. But if you don't have enough control over that workbook, you can still have your macro use a completely different workbook, too. -- Dave Peterson |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VLookup Error in Part of a Named Range | Dallas64 | Worksheet Functions | 6 | April 18th, 2006 02:13 PM |
Updating a named range | joala | Worksheet Functions | 2 | March 16th, 2006 06:10 PM |
Dynamic Named Range with blank cells | tjtjjtjt | General Discussion | 3 | October 5th, 2005 08:10 PM |
Pivot Tables - Named Range | dipsy | Worksheet Functions | 5 | August 23rd, 2005 04:50 PM |
Printing named range only | ray | Worksheet Functions | 4 | April 26th, 2004 05:29 PM |