Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop printing
I have a range of people's first names in a column, say Column A. I am after
a script that takes the first name of the list and puts it into a certain cell, say B1 (I need that so that some conditional formatting can take place somewhere else) and then executes a print command (I want to print a range that the conditional formating was applied to). Then it needs to put the second name in B1, print. Third name into B1, print ... I am pretty much stuck at the looping bit as my VB knowledge is very limited (but I am good at recording macros (-: ) Any help would be much appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop printing
If names start from cell A1
then for i=1 to range("A1").end(xldown).rows range("B1")=range("A" & i) ' do other things next i "George Hill" wrote in message ... I have a range of people's first names in a column, say Column A. I am after a script that takes the first name of the list and puts it into a certain cell, say B1 (I need that so that some conditional formatting can take place somewhere else) and then executes a print command (I want to print a range that the conditional formating was applied to). Then it needs to put the second name in B1, print. Third name into B1, print ... I am pretty much stuck at the looping bit as my VB knowledge is very limited (but I am good at recording macros (-: ) Any help would be much appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop printing
Brilliant! Thank you so much.
By the way, I get a Runtime Error 13 (Type Mismatch) in this line: for i=1 to range("A1").end(xldown).rows But never mind, I just have a =counta on the range in say C1 and then make it for i=1 to range("C1") - and that works. Thanks so much for your time. "PY & Associates" wrote: If names start from cell A1 then for i=1 to range("A1").end(xldown).rows range("B1")=range("A" & i) ' do other things next i "George Hill" wrote in message ... I have a range of people's first names in a column, say Column A. I am after a script that takes the first name of the list and puts it into a certain cell, say B1 (I need that so that some conditional formatting can take place somewhere else) and then executes a print command (I want to print a range that the conditional formating was applied to). Then it needs to put the second name in B1, print. Third name into B1, print ... I am pretty much stuck at the looping bit as my VB knowledge is very limited (but I am good at recording macros (-: ) Any help would be much appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Loop Function unable to loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
Worksheet_Change - loop within a loop | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |