![]() |
write a macro to print to search a list and print certain workshee
Hello,
I need help writing a macro. I have a table with information about 30 people, some are active, some are inactive. Each person has a worksheet assigned to them, and I have hyperlinks setup so once you click a person's number, excel goes to their sheet, and there are hyperlinks within each sheet to go back to the table. So, I want a macro that will search my table, and for each active person, go to their worksheet and print it. I will also mention that my hope is I can then copy that macro and apply it to a control button - to make it easier for my intended users of this file - rather than having them run a macro. Any suggestions? |
write a macro to print to search a list and print certain work
If you like, send your workbook to my address below along with a snippet of
this message copied to an inserted sheet. -- Don Guillett Microsoft MVP Excel SalesAid Software "Scott Smith" wrote in message ... Hello Don and thank you for the help. I have a few more questions. I apologize I'm not very familiar with macros. Let me give a few more details, I have a table with 30 people. Each person has a number, when I click on their number I am taken to that person's worksheet. To get back I click on their name - on their individual worksheet and I'm taken back to the master table. Also in a column (5 columns down from their number) is a column that has either active or inactive. How does that change / add to what you already indicated? Again thank you Scott "Don Guillett" wrote: Basically, you would use a for/each loop. Let's assume you have col A with name and col B with an "x" to indicate active. for each person in range("a2:a22") if person.offset(,1)="x" then 'do something such as sheets(person).printout end if next person -- Don Guillett Microsoft MVP Excel SalesAid Software "Scott Smith" <Scott wrote in message ... Hello, I need help writing a macro. I have a table with information about 30 people, some are active, some are inactive. Each person has a worksheet assigned to them, and I have hyperlinks setup so once you click a person's number, excel goes to their sheet, and there are hyperlinks within each sheet to go back to the table. So, I want a macro that will search my table, and for each active person, go to their worksheet and print it. I will also mention that my hope is I can then copy that macro and apply it to a control button - to make it easier for my intended users of this file - rather than having them run a macro. Any suggestions? |
write a macro to print to search a list and print certain work
I sent this based on #1, #2, etc in col A where 1,2, etc is the sheet name
and "Active" in col I Sub PrintActives() mc = "I" 'column I On Error Resume Next For i = 10 To Cells(Rows.Count, mc).End(xlUp).Row If Cells(i, mc) = "Active" Then Sheets(CStr(i - 10)).PrintPreview End If Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Don Guillett" wrote in message ... If you like, send your workbook to my address below along with a snippet of this message copied to an inserted sheet. -- Don Guillett Microsoft MVP Excel SalesAid Software "Scott Smith" wrote in message ... Hello Don and thank you for the help. I have a few more questions. I apologize I'm not very familiar with macros. Let me give a few more details, I have a table with 30 people. Each person has a number, when I click on their number I am taken to that person's worksheet. To get back I click on their name - on their individual worksheet and I'm taken back to the master table. Also in a column (5 columns down from their number) is a column that has either active or inactive. How does that change / add to what you already indicated? Again thank you Scott "Don Guillett" wrote: Basically, you would use a for/each loop. Let's assume you have col A with name and col B with an "x" to indicate active. for each person in range("a2:a22") if person.offset(,1)="x" then 'do something such as sheets(person).printout end if next person -- Don Guillett Microsoft MVP Excel SalesAid Software "Scott Smith" <Scott wrote in message ... Hello, I need help writing a macro. I have a table with information about 30 people, some are active, some are inactive. Each person has a worksheet assigned to them, and I have hyperlinks setup so once you click a person's number, excel goes to their sheet, and there are hyperlinks within each sheet to go back to the table. So, I want a macro that will search my table, and for each active person, go to their worksheet and print it. I will also mention that my hope is I can then copy that macro and apply it to a control button - to make it easier for my intended users of this file - rather than having them run a macro. Any suggestions? |
All times are GMT +1. The time now is 07:37 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com