Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need Macro to print a sheet conatining drop down menu

Hi,

I got a worksheet with drop down menu containg 10 items in the drop
down and other information connected to database. i want to print each
item from the drop down menu. so i don't want to choose each item
every time and then print. so in normal case i have to select each
item and then click on print.so i have to do this 10 times. all i want
to do is with one click it should select automatically from the drop
down menu and print. but i have tried recording the macro but is not
working.it is selecting active sheet and what ever the item is active
in the drop down it prints q0 times. so i need someone who can write a
macro that can choose the second item, third item and so on and print
them indivdually.

any info related to the query is highly appreciated.

Thanks in advance.

Faizal Cassim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need Macro to print a sheet conatining drop down menu

Sub PrintAutoFilterItems()
Dim nodupes As New Collection
Dim rng As Range
Dim Cell As Range
Dim item As Variant
Set rng = ActiveSheet.AutoFilter.Range.Columns(1).Cells
Debug.Print rng.Count, rng.Address
On Error Resume Next
For Each Cell In rng
If Cell.Row < rng(1).Row Then
nodupes.Add Cell.Value, Cell.Text
End If
Next

For Each item In nodupes
ActiveSheet.AutoFilter.Range.AutoFilter _
Field:=1, Criteria1:=item
ActiveSheet.PrintPreview
Next item

End Sub

Assumes you are talking about an autofilter and not a pivot table and that
you are filtering on the first column in the autofilter. (Easily altered
for filtering in other columns).

--
Regards,
Tom Ogilvy



"Faizal" wrote in message
om...
Hi,

I got a worksheet with drop down menu containg 10 items in the drop
down and other information connected to database. i want to print each
item from the drop down menu. so i don't want to choose each item
every time and then print. so in normal case i have to select each
item and then click on print.so i have to do this 10 times. all i want
to do is with one click it should select automatically from the drop
down menu and print. but i have tried recording the macro but is not
working.it is selecting active sheet and what ever the item is active
in the drop down it prints q0 times. so i need someone who can write a
macro that can choose the second item, third item and so on and print
them indivdually.

any info related to the query is highly appreciated.

Thanks in advance.

Faizal Cassim



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
How do you print drop down menu Becci Excel Discussion (Misc queries) 5 September 26th 08 11:22 PM
updating sheet by choice from drop down menu kal4000 Excel Discussion (Misc queries) 2 June 30th 08 08:54 PM
Macro Drop Down Menu MCook Excel Discussion (Misc queries) 1 October 11th 07 09:12 PM
how to activate a drop down menu in spreed sheet with space bar? Raza Excel Discussion (Misc queries) 0 April 20th 06 05:21 PM
Is there a way to ReName a Sheet Using a Drop Down Menu? steve Excel Programming 0 August 22nd 03 06:23 PM


All times are GMT +1. The time now is 03:52 PM.

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

About Us

"It's about Microsoft Excel"