Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Lyn Lyn is offline
external usenet poster
 
Posts: 40
Default Do not want hidden rows to be included in merge

I have a number of rows hidden on a spreadsheet and I do not want them
included when I do a mail merge; is there a way to exclude them other than
"deselecting" them when the Mail Merge Receipients box pops up?
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Do not want hidden rows to be included in merge

I don't think there's a way to select rows solely on the basis of
whether they are hidden or not.

If it makes sense to introduce another column called "Hidden" (say) and
mark hidden entries as y (or perhaps), then you can at least select
using the dropdown or query options within Word's Edit Recipients dialog
box, rather than having to select each record individually. But then you
would have to maintain the values in that column in Excel...

....unless you can define a user-defined worksheet function using Excel
VBA to detect whether the row is hidden.

e.g., in a new Module of the Workbook, put the following function code:

Function isHidden() As Variant
Application.Volatile (True)
isHidden = Abs(CInt(Application.Caller.EntireRow.HIDDEN))
End Function

Then put the formula

=isHidden()

in the first data cell of the Hidden column, and copy the formula into
all the cells in the column

Then as you hide/unhide rows, the value should change - it should be 1
for hidden rows and 0 for visible rows. Since of course you cannot
actually see the value in hidden rows, you might want to test that it is
behaving as you want - e.g. if the Hidden column is column F and row 5
is hidden, a cell containing a formula such as =F5 should have value 1

And even then, you still have to make sure that every cell in that
column has the =isHidden() formula in it, e.g. when you add rows to your
sheet. Also, be aware that using Application.Volatile can slow down
sheet recalculation.


Peter Jamieson

http://tips.pjmsn.me.uk

On 10/11/2009 17:56, Lyn wrote:
I have a number of rows hidden on a spreadsheet and I do not want them
included when I do a mail merge; is there a way to exclude them other than
"deselecting" them when the Mail Merge Receipients box pops up?

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table not included in email after merge Holly Mailmerge 7 November 13th 09 04:03 PM
gridlines hidden rows Luís Miguel Ramires Vieira Reis RAM Tables 1 December 19th 08 07:35 PM
Mail Merge with Picture file name included in excel crazymfr Mailmerge 3 June 28th 07 03:39 PM
'Tables'- 2 columns,4 rows. Can you merge one column into 3 rows? CalMac Captain Tables 1 May 19th 06 03:27 PM
How do I renumber a database (w/hidden rows) to make it sequencial DWH Mailmerge 1 January 28th 05 05:08 PM


All times are GMT +1. The time now is 04:49 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"