Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 145
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Loop Function unable to loop Junior728 Excel Programming 1 July 28th 05 10:23 AM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
Worksheet_Change - loop within a loop bgm Excel Programming 1 January 19th 04 01:27 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 07:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"