Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Only print cells with value Part 2

I have a membership list that lists the church contributions made each week
and also gives the total cntributions for the year.
I want to print out a separate form for each member that has contributed
money during the year for income tax purposes
Thanks in advance

Tom Oqilvy wrote
assume you have sheets

summarylist list of contributors, 1 per row
Detail weekly contributions 52 wks x member rows
form sheet to print out

You want to copy the up to 52 rows of data form detail to form for printout
for each paying member.


with worksheets("SummaryList")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
End With
for each cell in rng
' to see if has given this year - check column F
if cell.offset(0,5) 0 then
' Clear form sheet
Worksheets("Form").Range("A5:A56").EntireRow.Clear Contents
' use cell as a filter criteria on detail sheet
With worksheets("Detail").Range("A1").currentRegion
..Autofilter Field:=1, Criteria1:=cell.value
..rows.copy Worksheets("Form").Range("A5")
End With
with worksheets("form")
..range("B2").Value = cell
..range("J2").Value = Date
..printout
End with
end if
Next

I wrote but for some reason it did not post

"I should have given more info

I have a sheet (Records) that has a range "Database" that has in col A
Member#, col B the last name of the member, C with the first name, Col E
Address1, F city, G State, H zip and other cols thru M with other info.
Infomation is entered thru a user form.

I have a sheet "Contributions" which I import "Dasebase" then hide Col A and
Col lI thru M
In col N I have the formula =IF(SUM(O3:BN3)=0,"",SUM(O3:BN3))
Col O thru BN have the 52 weeke in the year
In Sheet "TaxForm" I have
cell B3 for the FirstName,
cell B4 for the LastName,
cell B5 for the Address1
cell B6 for the City,
cell B7 for the State,
cell B8 for the zip
cell B9 for the Total Contributions
Again I wish to print out a form for each menber that gave a contribution
during the year

oldjay
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Only print cells with value Part 2

sub PrintoutTax()
Dim sh as Wroksheet, sh1 as Worksheet
Dim rw as Long
set sh1 = Worksheets("TaxForm")
set sh = worksheets("Contributions")
with sh
rw = 3
do while sh.cells(rw,1)< ""
if sh.cells(rw,"N") < "" then
sh1.Range("B3").Value = sh.Cells(rw,"C").Value
sh1.Range("B4").Value = sh.Cells(rw,"B").Value
sh.cells(rw,"E").Resize(1,4).copy
sh1.Range("B5").PasteSpecial xlvalues, transpose:=True
sh1.Range("B9").Value = sh.Cells(rw,"N").Value
sh1.Printout
end if
rw = rw + 1
Loop
End sub

--
Regards,
Tom Ogilvy


"Oldjay" wrote:

I have a membership list that lists the church contributions made each week
and also gives the total cntributions for the year.
I want to print out a separate form for each member that has contributed
money during the year for income tax purposes
Thanks in advance

Tom Oqilvy wrote
assume you have sheets

summarylist list of contributors, 1 per row
Detail weekly contributions 52 wks x member rows
form sheet to print out

You want to copy the up to 52 rows of data form detail to form for printout
for each paying member.


with worksheets("SummaryList")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
End With
for each cell in rng
' to see if has given this year - check column F
if cell.offset(0,5) 0 then
' Clear form sheet
Worksheets("Form").Range("A5:A56").EntireRow.Clear Contents
' use cell as a filter criteria on detail sheet
With worksheets("Detail").Range("A1").currentRegion
.Autofilter Field:=1, Criteria1:=cell.value
.rows.copy Worksheets("Form").Range("A5")
End With
with worksheets("form")
.range("B2").Value = cell
.range("J2").Value = Date
.printout
End with
end if
Next

I wrote but for some reason it did not post

"I should have given more info

I have a sheet (Records) that has a range "Database" that has in col A
Member#, col B the last name of the member, C with the first name, Col E
Address1, F city, G State, H zip and other cols thru M with other info.
Infomation is entered thru a user form.

I have a sheet "Contributions" which I import "Dasebase" then hide Col A and
Col lI thru M
In col N I have the formula =IF(SUM(O3:BN3)=0,"",SUM(O3:BN3))
Col O thru BN have the 52 weeke in the year
In Sheet "TaxForm" I have
cell B3 for the FirstName,
cell B4 for the LastName,
cell B5 for the Address1
cell B6 for the City,
cell B7 for the State,
cell B8 for the zip
cell B9 for the Total Contributions
Again I wish to print out a form for each menber that gave a contribution
during the year

oldjay

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Only print cells with value Part 2

Thanks Tom It got me pointed in the right direction
oldjay
PS- Minor corrections You had worksheet spelled wromg and you forgot End
With


"Tom Ogilvy" wrote:

sub PrintoutTax()
Dim sh as Wroksheet, sh1 as Worksheet
Dim rw as Long
set sh1 = Worksheets("TaxForm")
set sh = worksheets("Contributions")
with sh
rw = 3
do while sh.cells(rw,1)< ""
if sh.cells(rw,"N") < "" then
sh1.Range("B3").Value = sh.Cells(rw,"C").Value
sh1.Range("B4").Value = sh.Cells(rw,"B").Value
sh.cells(rw,"E").Resize(1,4).copy
sh1.Range("B5").PasteSpecial xlvalues, transpose:=True
sh1.Range("B9").Value = sh.Cells(rw,"N").Value
sh1.Printout
end if
rw = rw + 1
Loop
End sub

--
Regards,
Tom Ogilvy


"Oldjay" wrote:

I have a membership list that lists the church contributions made each week
and also gives the total cntributions for the year.
I want to print out a separate form for each member that has contributed
money during the year for income tax purposes
Thanks in advance

Tom Oqilvy wrote
assume you have sheets

summarylist list of contributors, 1 per row
Detail weekly contributions 52 wks x member rows
form sheet to print out

You want to copy the up to 52 rows of data form detail to form for printout
for each paying member.


with worksheets("SummaryList")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
End With
for each cell in rng
' to see if has given this year - check column F
if cell.offset(0,5) 0 then
' Clear form sheet
Worksheets("Form").Range("A5:A56").EntireRow.Clear Contents
' use cell as a filter criteria on detail sheet
With worksheets("Detail").Range("A1").currentRegion
.Autofilter Field:=1, Criteria1:=cell.value
.rows.copy Worksheets("Form").Range("A5")
End With
with worksheets("form")
.range("B2").Value = cell
.range("J2").Value = Date
.printout
End with
end if
Next

I wrote but for some reason it did not post

"I should have given more info

I have a sheet (Records) that has a range "Database" that has in col A
Member#, col B the last name of the member, C with the first name, Col E
Address1, F city, G State, H zip and other cols thru M with other info.
Infomation is entered thru a user form.

I have a sheet "Contributions" which I import "Dasebase" then hide Col A and
Col lI thru M
In col N I have the formula =IF(SUM(O3:BN3)=0,"",SUM(O3:BN3))
Col O thru BN have the 52 weeke in the year
In Sheet "TaxForm" I have
cell B3 for the FirstName,
cell B4 for the LastName,
cell B5 for the Address1
cell B6 for the City,
cell B7 for the State,
cell B8 for the zip
cell B9 for the Total Contributions
Again I wish to print out a form for each menber that gave a contribution
during the year

oldjay

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Only print cells with value Part 2

Actually With Sh isn't need. - so I must have forgotten to delete it and I
admit, I mispelled worksheet.

--
Regards,
Tom Ogilvy


"Oldjay" wrote:

Thanks Tom It got me pointed in the right direction
oldjay
PS- Minor corrections You had worksheet spelled wromg and you forgot End
With


"Tom Ogilvy" wrote:

sub PrintoutTax()
Dim sh as Wroksheet, sh1 as Worksheet
Dim rw as Long
set sh1 = Worksheets("TaxForm")
set sh = worksheets("Contributions")
with sh
rw = 3
do while sh.cells(rw,1)< ""
if sh.cells(rw,"N") < "" then
sh1.Range("B3").Value = sh.Cells(rw,"C").Value
sh1.Range("B4").Value = sh.Cells(rw,"B").Value
sh.cells(rw,"E").Resize(1,4).copy
sh1.Range("B5").PasteSpecial xlvalues, transpose:=True
sh1.Range("B9").Value = sh.Cells(rw,"N").Value
sh1.Printout
end if
rw = rw + 1
Loop
End sub

--
Regards,
Tom Ogilvy


"Oldjay" wrote:

I have a membership list that lists the church contributions made each week
and also gives the total cntributions for the year.
I want to print out a separate form for each member that has contributed
money during the year for income tax purposes
Thanks in advance

Tom Oqilvy wrote
assume you have sheets

summarylist list of contributors, 1 per row
Detail weekly contributions 52 wks x member rows
form sheet to print out

You want to copy the up to 52 rows of data form detail to form for printout
for each paying member.


with worksheets("SummaryList")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
End With
for each cell in rng
' to see if has given this year - check column F
if cell.offset(0,5) 0 then
' Clear form sheet
Worksheets("Form").Range("A5:A56").EntireRow.Clear Contents
' use cell as a filter criteria on detail sheet
With worksheets("Detail").Range("A1").currentRegion
.Autofilter Field:=1, Criteria1:=cell.value
.rows.copy Worksheets("Form").Range("A5")
End With
with worksheets("form")
.range("B2").Value = cell
.range("J2").Value = Date
.printout
End with
end if
Next

I wrote but for some reason it did not post

"I should have given more info

I have a sheet (Records) that has a range "Database" that has in col A
Member#, col B the last name of the member, C with the first name, Col E
Address1, F city, G State, H zip and other cols thru M with other info.
Infomation is entered thru a user form.

I have a sheet "Contributions" which I import "Dasebase" then hide Col A and
Col lI thru M
In col N I have the formula =IF(SUM(O3:BN3)=0,"",SUM(O3:BN3))
Col O thru BN have the 52 weeke in the year
In Sheet "TaxForm" I have
cell B3 for the FirstName,
cell B4 for the LastName,
cell B5 for the Address1
cell B6 for the City,
cell B7 for the State,
cell B8 for the zip
cell B9 for the Total Contributions
Again I wish to print out a form for each menber that gave a contribution
during the year

oldjay

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
Can I put button on spreadsheet to make it print a specific part? CindyMc Excel Worksheet Functions 2 October 26th 09 07:33 PM
Prints only part of specificed print area diane22 Excel Discussion (Misc queries) 1 April 21st 09 12:30 AM
Part of number does not print RoniB Excel Discussion (Misc queries) 0 April 11th 07 03:42 PM
print only the part of the sheet that has data ranger1701 Setting up and Configuration of Excel 2 January 10th 07 03:43 PM
Print part of a viewable report Kris Trester Excel Discussion (Misc queries) 1 July 7th 05 05:11 PM


All times are GMT +1. The time now is 03:13 PM.

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"