I need help with creating a special macro .

G

Guest

I have a work sheet with a list of members. This list contains the name, SS#,
and the amount of dues owed to date. I have a form on another work sheet, in
the same workbook. How do I create a macro taking the info on the list,
puting it on the form and printing the Dues Statement. I then have to repeat
this for eash member until the end of the list.
 
G

Guest

hi,
reduce everything down to variable and have this variable
= that variable and put the whole thing in a print loop.
maybe.
the form on the other sheet, is it a user form or a
template?
 
B

Bernie Deitrick

Julian,

Let's say that you have SS in column A, something else in B, C, and D, and
you want that information to to into Sheet2 cells B2B5.

Something along the lines of

Sub PrintReports()
Dim myCell As Range

For Each myCell In Worksheets("Sheet1").Range("A2:A123")
With Worksheets("Sheet2")
.Range("B2").Value = myCell.Value
.Range("B3").Value = myCell(1,2).Value
.Range("B4").Value = myCell(1,3).Value
.Range("B5").Value = myCell(1,4).Value
.Printout
End With
Next myCell

End Sub

HTH,
Bernie
MS Excel MVP
 
B

Bernie Deitrick

Julian,

Visit

http://www.mvps.org/dmcritchie/excel/getstarted.htm

for how to work with macro code.

As for the specific code, post back with:

Your sheet names.
The cells that have the SS #'s
The cells that have the other data.
Which sheet you want printed.
Which cells on that sheet should have what information.

And then I will modify my code to match your specifics.

HTH,
Bernie
MS Excel MVP
 
G

Guest

I am the record keeper for The Riders Club. The workbook is titled The Riders
Dues. The two sheets I am working with are Balances & Statement. I want to
pull data from the Balances and print Statements.

Per Balances - Name A5, Date Joined B5, SS# C5, Yrs in Club F5, Bal due M5,
Past due N5.

I would like to have this repeat printing up to the end of the list.

Thank you

JulianB
 
B

Bernie Deitrick

Julian,

Do the names start in cell A5, and go down the column? Where on sheet
Statement does the name go? Where do all the other values need to go?

HTH,
Bernie
MS Excel MVP
 
G

Guest

The names are in the first column and they go down. Names go to the Statement
cell C11, Start Dates go to D24, SS#s go to J11, Yrs in Club go to H25, Bal
Due go to J34 and Past Due go to J34. Then in need to print each statement.

I really appreciate this.

JulianB
 
B

Bernie Deitrick

Julian,

Assuming that 1) Bal Due goes to J34 and Past Due goes to another cell, (I
Bal Due go to J34 and Past Due go to J34..

and 2) your names start in row 2, and there aren't any blank lines within
your data

Then this is your sub:

Sub PrintReports2()
Dim myCell As Range

For Each myCell In Range(Worksheets("Balances").Range("A2"), _
Worksheets("Balances").Range("A65536").End(xlUp))
With Worksheets("Statement")
.Range("C11").Value = myCell.Value
.Range("D24").Value = myCell(1, 2).Value
.Range("J11").Value = myCell(1, 3).Value
.Range("H25").Value = myCell(1, 6).Value
.Range("J34").Value = myCell(1, 13).Value
.Range("J35").Value = myCell(1, 14).Value
.PrintOut
End With
Next myCell

End Sub

HTH,
Bernie
MS Excel MVP
 
G

Guest

You are correct the Bal Due S/B J32 and The Past Due S/B J34. I will change
the sub. Thank you for taking the time to help me. Assuming I set up this sub
correctly I will finally be able to reduce my time for billing.

Thanks Much

Julian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top