Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Print Dynamic Report: Macro

1) I have a report in sheet 1 that is populated by data in another sheet
using vlookup.
2) I have a range name = "list" (in sheet 1 as well, which lists ticker
symbol)
3) I would like the macro to loop through all the names in the "list" range
and print the reports.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Print Dynamic Report: Macro

Also for purposes of this ex/ I would like each name copied to cell A1, as
the vlookup keys off A1 to update the report, cycling through the list and
printing each report. -- Thanks

"Lightjag" wrote:

1) I have a report in sheet 1 that is populated by data in another sheet
using vlookup.
2) I have a range name = "list" (in sheet 1 as well, which lists ticker
symbol)
3) I would like the macro to loop through all the names in the "list" range
and print the reports.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Print Dynamic Report: Macro

Ok the macro below cycles throught the list but only prints when it gets to
bottom of list. What should I change to get it to print each time is cycles
throught the list? Tks


Sub printinfo()
Dim n As Integer
n = 1
Do
Application.Goto Reference:="list"
ActiveCell.Offset(n + 1, 0).Select
Selection.copy
Application.Goto Reference:="ticker"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SelectedSheets.PrintOut
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub

"Lightjag" wrote:

Also for purposes of this ex/ I would like each name copied to cell A1, as
the vlookup keys off A1 to update the report, cycling through the list and
printing each report. -- Thanks

"Lightjag" wrote:

1) I have a report in sheet 1 that is populated by data in another sheet
using vlookup.
2) I have a range name = "list" (in sheet 1 as well, which lists ticker
symbol)
3) I would like the macro to loop through all the names in the "list" range
and print the reports.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Print Dynamic Report: Macro

Any ideas?

"Lightjag" wrote:

Ok the macro below cycles throught the list but only prints when it gets to
bottom of list. What should I change to get it to print each time is cycles
throught the list? Tks


Sub printinfo()
Dim n As Integer
n = 1
Do
Application.Goto Reference:="list"
ActiveCell.Offset(n + 1, 0).Select
Selection.copy
Application.Goto Reference:="ticker"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SelectedSheets.PrintOut
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub

"Lightjag" wrote:

Also for purposes of this ex/ I would like each name copied to cell A1, as
the vlookup keys off A1 to update the report, cycling through the list and
printing each report. -- Thanks

"Lightjag" wrote:

1) I have a report in sheet 1 that is populated by data in another sheet
using vlookup.
2) I have a range name = "list" (in sheet 1 as well, which lists ticker
symbol)
3) I would like the macro to loop through all the names in the "list" range
and print the reports.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Print Dynamic Report: Macro

Hi
In first sub n is not being incremented. Put in
n = n+1
after the printout line.
Don't know what you want in your second question. What is a name? What
does "vlookup keys off A1" mean?
regards
Paul
On Mar 13, 6:18*pm, Lightjag
wrote:
Any ideas?

"Lightjag" wrote:
Ok the macro below cycles throught the list but only prints when it gets to
bottom of list. What should I change to get it to print each time is cycles
throught the list? Tks


Sub printinfo()
* * *Dim n As Integer
* * *n = 1
* * *Do
* * *Application.Goto Reference:="list"
* * *ActiveCell.Offset(n + 1, 0).Select
* * *Selection.copy
* * *Application.Goto Reference:="ticker"
* * *Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
* * * * :=False, Transpose:=False
* * *ActiveWindow.SelectedSheets.PrintOut
* * *Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub


"Lightjag" wrote:


Also for purposes of this ex/ I would like each name copied to cell A1, as
the vlookup keys off A1 to update the report, cycling through the list and
printing each report. -- Thanks


"Lightjag" wrote:


1) I have a report in sheet 1 that is populated by data in another sheet
using vlookup.
2) I have a range name = "list" (in sheet 1 as well, which lists ticker
symbol)
3) I would like the macro to loop through all the names in the "list" range
and print the reports.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Print Dynamic Report: Macro

Ok I made the change, but it still only prints the last item in the list
(instead of printing each item in the list). Vlookup is just not the issue
here, as it is just updating the report based on the value in cell A1.

" wrote:

Hi
In first sub n is not being incremented. Put in
n = n+1
after the printout line.
Don't know what you want in your second question. What is a name? What
does "vlookup keys off A1" mean?
regards
Paul
On Mar 13, 6:18 pm, Lightjag
wrote:
Any ideas?

"Lightjag" wrote:
Ok the macro below cycles throught the list but only prints when it gets to
bottom of list. What should I change to get it to print each time is cycles
throught the list? Tks


Sub printinfo()
Dim n As Integer
n = 1
Do
Application.Goto Reference:="list"
ActiveCell.Offset(n + 1, 0).Select
Selection.copy
Application.Goto Reference:="ticker"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SelectedSheets.PrintOut
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub


"Lightjag" wrote:


Also for purposes of this ex/ I would like each name copied to cell A1, as
the vlookup keys off A1 to update the report, cycling through the list and
printing each report. -- Thanks


"Lightjag" wrote:


1) I have a report in sheet 1 that is populated by data in another sheet
using vlookup.
2) I have a range name = "list" (in sheet 1 as well, which lists ticker
symbol)
3) I would like the macro to loop through all the names in the "list" range
and print the reports.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Print Dynamic Report: Macro

Hi
It is pasting everything to one place "ticker" so you only see the
last one. You probably need to use offset like
Range("ticker").offset(n,1) to print n rows below "ticker".
regards
Paul

On Mar 14, 2:10*pm, Lightjag
wrote:
Ok I made the change, but it still only prints the last item in the list
(instead of printing each item in the list). *Vlookup is just not the issue
here, as it is just updating the report based on the value in cell A1. *

" wrote:
Hi
In first sub n is not being incremented. Put in
n = n+1
after the printout line.
Don't know what you want in your second question. What is a name? What
does "vlookup keys off A1" mean?
regards
Paul
On Mar 13, 6:18 pm, Lightjag
wrote:
Any ideas?


"Lightjag" wrote:
Ok the macro below cycles throught the list but only prints when it gets to
bottom of list. What should I change to get it to print each time is cycles
throught the list? Tks


Sub printinfo()
* * *Dim n As Integer
* * *n = 1
* * *Do
* * *Application.Goto Reference:="list"
* * *ActiveCell.Offset(n + 1, 0).Select
* * *Selection.copy
* * *Application.Goto Reference:="ticker"
* * *Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
* * * * :=False, Transpose:=False
* * *ActiveWindow.SelectedSheets.PrintOut
* * *Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub


"Lightjag" wrote:


Also for purposes of this ex/ I would like each name copied to cell A1, as
the vlookup keys off A1 to update the report, cycling through the list and
printing each report. -- Thanks


"Lightjag" wrote:


1) I have a report in sheet 1 that is populated by data in another sheet
using vlookup.
2) I have a range name = "list" (in sheet 1 as well, which lists ticker
symbol)
3) I would like the macro to loop through all the names in the "list" range
and print the reports.


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Print Dynamic Report: Macro

Ok, I added the code, but I still have the same problem. Just to recap, I
have a "list" in col 1a:a3, I want to copy the cell a1 to location ticker and
print report, then copy a2 to ticker and print report and then copy a3 to
location ticker and print report. the report updates based on the value
pasted into location ticker. The macro below cycles through a1:a3, but only
prints once (i.e. when it gets to end of list, a3). It should be printing
each time a value is pasted into location "ticker". Below is what the
current code looks like.

Sub printinfo()
Dim n As Integer
n = 1
Do
Application.Goto Reference:="list"
ActiveCell.Offset(n + 1, 0).Select
Selection.copy
Application.Goto Reference:="ticker"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("ticker").Offset(n, 1).Select
ActiveWindow.SelectedSheets.PrintOut
n = n + 1
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub

" wrote:

Hi
It is pasting everything to one place "ticker" so you only see the
last one. You probably need to use offset like
Range("ticker").offset(n,1) to print n rows below "ticker".
regards
Paul

On Mar 14, 2:10 pm, Lightjag
wrote:
Ok I made the change, but it still only prints the last item in the list
(instead of printing each item in the list). Vlookup is just not the issue
here, as it is just updating the report based on the value in cell A1.

" wrote:
Hi
In first sub n is not being incremented. Put in
n = n+1
after the printout line.
Don't know what you want in your second question. What is a name? What
does "vlookup keys off A1" mean?
regards
Paul
On Mar 13, 6:18 pm, Lightjag
wrote:
Any ideas?


"Lightjag" wrote:
Ok the macro below cycles throught the list but only prints when it gets to
bottom of list. What should I change to get it to print each time is cycles
throught the list? Tks


Sub printinfo()
Dim n As Integer
n = 1
Do
Application.Goto Reference:="list"
ActiveCell.Offset(n + 1, 0).Select
Selection.copy
Application.Goto Reference:="ticker"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SelectedSheets.PrintOut
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub


"Lightjag" wrote:


Also for purposes of this ex/ I would like each name copied to cell A1, as
the vlookup keys off A1 to update the report, cycling through the list and
printing each report. -- Thanks


"Lightjag" wrote:


1) I have a report in sheet 1 that is populated by data in another sheet
using vlookup.
2) I have a range name = "list" (in sheet 1 as well, which lists ticker
symbol)
3) I would like the macro to loop through all the names in the "list" range
and print the reports.



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Print Dynamic Report: Macro

Ok now it works: cycles through each item in list, copies to a location,
prints report during each cycle. I changed:

A) "Loop Until IsEmpty(ActiveCell.Offset(0, 1))" to "Loop Until
IsEmpty(ActiveCell.Offset(0, 0))"
and
B) "ActiveCell.Offset(n +1 , 0).Select" to "ActiveCell.Offset(n,
0).Select"......as it was skipping the first item in the list.

All changes:

Sub printinfo()
Dim n As Integer
n = 0
Do
Application.Goto Reference:="list"
ActiveCell.Offset(n, 0).Select
Selection.copy
Application.Goto Reference:="ticker"
' Pastes value to location "ticker"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SelectedSheets.PrintOut
n = n + 1
Loop Until IsEmpty(ActiveCell.Offset(0, 0))
End Sub







The only issue I have is it print a blank at the end. Ex/ is I have 3 items
in a list it prints all 3 plus copies and pastes a blank and then prints it,
or if there are 5 items it prints a 6th rpt (ie. blank).

Any suggestions on how to get it to stop so it does not print the last rpt
which is blank (i.e. gets to end of "list")?






"Lightjag" wrote:

Ok, I added the code, but I still have the same problem. Just to recap, I
have a "list" in col 1a:a3, I want to copy the cell a1 to location ticker and
print report, then copy a2 to ticker and print report and then copy a3 to
location ticker and print report. the report updates based on the value
pasted into location ticker. The macro below cycles through a1:a3, but only
prints once (i.e. when it gets to end of list, a3). It should be printing
each time a value is pasted into location "ticker". Below is what the
current code looks like.

Sub printinfo()
Dim n As Integer
n = 1
Do
Application.Goto Reference:="list"
ActiveCell.Offset(n + 1, 0).Select
Selection.copy
Application.Goto Reference:="ticker"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("ticker").Offset(n, 1).Select
ActiveWindow.SelectedSheets.PrintOut
n = n + 1
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub

" wrote:

Hi
It is pasting everything to one place "ticker" so you only see the
last one. You probably need to use offset like
Range("ticker").offset(n,1) to print n rows below "ticker".
regards
Paul

On Mar 14, 2:10 pm, Lightjag
wrote:
Ok I made the change, but it still only prints the last item in the list
(instead of printing each item in the list). Vlookup is just not the issue
here, as it is just updating the report based on the value in cell A1.

" wrote:
Hi
In first sub n is not being incremented. Put in
n = n+1
after the printout line.
Don't know what you want in your second question. What is a name? What
does "vlookup keys off A1" mean?
regards
Paul
On Mar 13, 6:18 pm, Lightjag
wrote:
Any ideas?

"Lightjag" wrote:
Ok the macro below cycles throught the list but only prints when it gets to
bottom of list. What should I change to get it to print each time is cycles
throught the list? Tks

Sub printinfo()
Dim n As Integer
n = 1
Do
Application.Goto Reference:="list"
ActiveCell.Offset(n + 1, 0).Select
Selection.copy
Application.Goto Reference:="ticker"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SelectedSheets.PrintOut
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub

"Lightjag" wrote:

Also for purposes of this ex/ I would like each name copied to cell A1, as
the vlookup keys off A1 to update the report, cycling through the list and
printing each report. -- Thanks

"Lightjag" wrote:

1) I have a report in sheet 1 that is populated by data in another sheet
using vlookup.
2) I have a range name = "list" (in sheet 1 as well, which lists ticker
symbol)
3) I would like the macro to loop through all the names in the "list" range
and print the reports.



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Print Dynamic Report: Macro

Problem solved: mcro stops when it finds an empty cell, by adding " If
IsEmpty(ActiveCell) Then End" .....I added it below row "ActiveCell.Offset(n,
0).Select"

"Lightjag" wrote:

Ok now it works: cycles through each item in list, copies to a location,
prints report during each cycle. I changed:

A) "Loop Until IsEmpty(ActiveCell.Offset(0, 1))" to "Loop Until
IsEmpty(ActiveCell.Offset(0, 0))"
and
B) "ActiveCell.Offset(n +1 , 0).Select" to "ActiveCell.Offset(n,
0).Select"......as it was skipping the first item in the list.

All changes:

Sub printinfo()
Dim n As Integer
n = 0
Do
Application.Goto Reference:="list"
ActiveCell.Offset(n, 0).Select
Selection.copy
Application.Goto Reference:="ticker"
' Pastes value to location "ticker"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SelectedSheets.PrintOut
n = n + 1
Loop Until IsEmpty(ActiveCell.Offset(0, 0))
End Sub







The only issue I have is it print a blank at the end. Ex/ is I have 3 items
in a list it prints all 3 plus copies and pastes a blank and then prints it,
or if there are 5 items it prints a 6th rpt (ie. blank).

Any suggestions on how to get it to stop so it does not print the last rpt
which is blank (i.e. gets to end of "list")?






"Lightjag" wrote:

Ok, I added the code, but I still have the same problem. Just to recap, I
have a "list" in col 1a:a3, I want to copy the cell a1 to location ticker and
print report, then copy a2 to ticker and print report and then copy a3 to
location ticker and print report. the report updates based on the value
pasted into location ticker. The macro below cycles through a1:a3, but only
prints once (i.e. when it gets to end of list, a3). It should be printing
each time a value is pasted into location "ticker". Below is what the
current code looks like.

Sub printinfo()
Dim n As Integer
n = 1
Do
Application.Goto Reference:="list"
ActiveCell.Offset(n + 1, 0).Select
Selection.copy
Application.Goto Reference:="ticker"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("ticker").Offset(n, 1).Select
ActiveWindow.SelectedSheets.PrintOut
n = n + 1
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub

" wrote:

Hi
It is pasting everything to one place "ticker" so you only see the
last one. You probably need to use offset like
Range("ticker").offset(n,1) to print n rows below "ticker".
regards
Paul

On Mar 14, 2:10 pm, Lightjag
wrote:
Ok I made the change, but it still only prints the last item in the list
(instead of printing each item in the list). Vlookup is just not the issue
here, as it is just updating the report based on the value in cell A1.

" wrote:
Hi
In first sub n is not being incremented. Put in
n = n+1
after the printout line.
Don't know what you want in your second question. What is a name? What
does "vlookup keys off A1" mean?
regards
Paul
On Mar 13, 6:18 pm, Lightjag
wrote:
Any ideas?

"Lightjag" wrote:
Ok the macro below cycles throught the list but only prints when it gets to
bottom of list. What should I change to get it to print each time is cycles
throught the list? Tks

Sub printinfo()
Dim n As Integer
n = 1
Do
Application.Goto Reference:="list"
ActiveCell.Offset(n + 1, 0).Select
Selection.copy
Application.Goto Reference:="ticker"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SelectedSheets.PrintOut
Loop Until IsEmpty(ActiveCell.Offset(0, 1))
End Sub

"Lightjag" wrote:

Also for purposes of this ex/ I would like each name copied to cell A1, as
the vlookup keys off A1 to update the report, cycling through the list and
printing each report. -- Thanks

"Lightjag" wrote:

1) I have a report in sheet 1 that is populated by data in another sheet
using vlookup.
2) I have a range name = "list" (in sheet 1 as well, which lists ticker
symbol)
3) I would like the macro to loop through all the names in the "list" range
and print the reports.


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
dynamic summary report Nicole[_2_] Excel Worksheet Functions 11 December 14th 08 02:45 AM
Dynamic chart pasted to a new workbook in report can't be dynamic Piotr (Peter)[_2_] Charts and Charting in Excel 2 August 6th 08 05:15 AM
Macro print range not dynamic like I wanted it to be TRYING Excel Worksheet Functions 8 November 27th 07 01:05 AM
Making print range dynamic in macro Newbie dumbo Excel Programming 1 December 14th 05 10:47 AM
Macro to print a dynamic range Russ Excel Programming 3 January 13th 05 05:31 PM


All times are GMT +1. The time now is 05:54 AM.

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

About Us

"It's about Microsoft Excel"