PC Review


Reply
Thread Tools Rate Thread

Complicated VBA? Moving filtered data....

 
 
TomorrowsMan
Guest
Posts: n/a
 
      16th Nov 2006
Hi, I've got a good one here I think:

I am trying to build a workbook that will limit the amount of extra
steps needed to get a set of names that are in a spreadsheet over to a
mail merge. So, what I would like to happen is:

1. User enters several rows of data on Sheet1.
2. User autofilters the rows by date, department, whatever.
3. User clicks a commandbutton to launch a macro that will send only
the filtered rows to MSWord to create the merge letters.

I think it will be pretty easy to set up the commandbutton to
automatically launch Word and create the merge docs, but I have no idea
how to send ONLY the filtered rows to the merge. Do I need to work
with a range?

Thanks a ton, as usual!

Chris

 
Reply With Quote
 
 
 
 
michael.beckinsale
Guest
Posts: n/a
 
      17th Nov 2006

TomorrowsMan,

A couple of suggestions:

1) Copy/Paste filtered rows to another sheet, delete blank rows, loop
thru and do whatever

Or

2) Loop through filtered range and testing to see if cell/ row .visible
property = True, if it is do whatever.

Regards

Michael Beckinsale

 
Reply With Quote
 
=?Utf-8?B?Sm9obg==?=
Guest
Posts: n/a
 
      17th Nov 2006
If .AutoFilter.Range.Columns(1).Cells.SpecialCells(xlCellTypeVisible).Count >
0 Then
With .AutoFilter.Range
.Resize(.Rows.Count - 1).Offset(1, 0).EntireRow.Delete
End With
End If

Good luck
John
Hi,

I use this bit of code to delete Filtered rows. I guess change the .Delete
for .Copy and add the range to copy to and it shoudl work!



"TomorrowsMan" wrote:

> Hi, I've got a good one here I think:
>
> I am trying to build a workbook that will limit the amount of extra
> steps needed to get a set of names that are in a spreadsheet over to a
> mail merge. So, what I would like to happen is:
>
> 1. User enters several rows of data on Sheet1.
> 2. User autofilters the rows by date, department, whatever.
> 3. User clicks a commandbutton to launch a macro that will send only
> the filtered rows to MSWord to create the merge letters.
>
> I think it will be pretty easy to set up the commandbutton to
> automatically launch Word and create the merge docs, but I have no idea
> how to send ONLY the filtered rows to the merge. Do I need to work
> with a range?
>
> Thanks a ton, as usual!
>
> Chris
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return filtered values into report worksheet based on filtered valueon the data worksheet dicko1 Microsoft Excel Worksheet Functions 1 21st Apr 2009 12:27 AM
Complicated VBA? Moving filtered data.... TomorrowsMan Microsoft Excel Worksheet Functions 2 17th Nov 2006 10:48 AM
Complicated VBA? Moving filtered data.... TomorrowsMan Microsoft Excel Misc 2 17th Nov 2006 10:48 AM
moving filtered data between worksheets automatically =?Utf-8?B?ZHdlZXp5?= Microsoft Excel Worksheet Functions 3 4th Oct 2006 03:10 PM
How to moving cursor when data are filtered jwan Microsoft Excel Misc 4 4th Sep 2004 01:37 AM


Features
 

Advertising
 

Newsgroups
 


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