Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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?




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
Print/Not print depending on dropdown list value Sam Kuo[_2_] Excel Programming 1 February 2nd 07 01:40 AM
How do I link a print header to variable data in multiple workshee ptaylor Excel Worksheet Functions 1 January 10th 07 11:45 AM
Newbie he I have a question about a print macro I am trying to write... Kyaba[_2_] Excel Programming 5 May 3rd 06 10:45 PM
How to write a macro to select print ranges that vary monthly wilson@irco[_2_] Excel Programming 8 February 27th 06 05:03 PM
How to write a macro to print a dir on my c drive Tony Excel Programming 2 May 28th 05 11:54 PM


All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"