A co-worker of mine has a data collection form entered into an Excel 97
spreadsheet. We would like to print out about 900 copies of this form,
each with a different name, employee number etc at the top.
The data is saved in an Excel file.
I couldn't seem to locate any built-in features of Excel to solve this
problem. I would guess a visual basic macro would solve this, but my macro
skills are not quite that advanced yet :)
Can anyone offer some help with this?
TIA
Assume form is on a sheet named Form1 and the name goes in cell B9
Dim rng as Range
With Worksheets("Sheet2")
Set rng = .Range(.Cells(1,1),.Cells(1,1).End(xldown))
End with
for each cell in rng
worksheets("Form1").Range("B9").Value = cell.Value
worksheets("Form1").Printout
Next
This further assumes that the form1 page is configured to print out as you
want it.
Regards,
Tom Ogilvy
User <us...@microsoft.com> wrote in message
news:Oo0kVh4TBHA.1448@tkmsftngp07...
"Tom Ogilvy" <twog...@email.msn.com> wrote in message
news:ueEMdn4TBHA.1848@tkmsftngp03...
Help again pls!
TIA
In Outlook Express this is set up in Tools, Accounts, Properities
FYI, Excel can act as the database for MS Word Mail Merge, see
http://www.mvps.org/dmcritchie/excel/mailmerg.htm
if you ever need to it that way. But it sounds like Tom's answer is
exactly what you wanted. I realize this was for someone else, but
the best kind of thanks is when thanks starts out with "it works" which also
means it was actually used.
HTH,
David McRitchie, Microsoft MVP - Excel [alternate/main sites below]
My Excel Macros: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.geocities.com/davemcritchie/excel/search.htm
"User" <us...@microsoft.com> wrote in message news:uUP9Uq4TBHA.2076@tkmsftngp03...
Just assign each source cell to the appropriate cell in the form.
Regards,
Tom Ogilvy
User <us...@microsoft.com> wrote in message
news:useXUg5TBHA.912@tkmsftngp07...
Sub testme()
Dim rng As Range
With Worksheets("Sheet2")
Set rng = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown))
End With
For Each cell In rng
With Worksheets("Form1")
'name
.Range("B9").Value = cell.Value
'employee
.Range("B11").Value = cell.Offset(0, 5).Value
'code
.Range("B22").Value = cell.Offset(0, 7).Value
.PrintOut
End With
Next
End Sub
Adjust B9, B11, B22 of the Form1 worksheet accordingly.
Also adjust the offset(0,X). This means use the same row that contains the name
but go X cells to the right.
cell.offset(0,5) <-- 5 to right
cell.offset(0,7) <-- 7 to right
--
Dave Peterson
ec3...@msn.com
That was easy, thanks so much again, I should manage to make it work from
here :)