Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a list of 30 names. A macro should input the first name into cell A1,
print the spreadsheet, input the second name into A1, print etc. The list can be either in a spreadsheet or in the VBA code. I used to copy-paste the following code 30 times and had to replace {name} each time. What is the more effective way? Thanx in advance! Range("A1").Select ActiveCell.FormulaR1C1 = {name} Range("A2").Select 'to calculate cells again ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like
For i = 1 To 30 Range("A1").Value = Worksheets("Sheet2").Cells(i,"M"(.Value ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Next i where M1:M30 on sheet2 holds the list of names -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "claudio" wrote in message ... I have a list of 30 names. A macro should input the first name into cell A1, print the spreadsheet, input the second name into A1, print etc. The list can be either in a spreadsheet or in the VBA code. I used to copy-paste the following code 30 times and had to replace {name} each time. What is the more effective way? Thanx in advance! Range("A1").Select ActiveCell.FormulaR1C1 = {name} Range("A2").Select 'to calculate cells again ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
When I input "25:03" as a time, it reads "1:03" | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
cannot use "Create List" and "Share Workbook" same time | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |