#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default hide/unhide

I am using winxp and msoffice 2003

I need to copy a named range from wbMaster to wbUser.
In wbUser many of the columns are hidden.
Do I need to unhide these columns in order to copy/pastespecial the
range from wbMaster?
Also, wbUser has several ws that need the same range copied to from the
wbMaster.
I am thinking that there must be a way to cycle thru the ws in wbUser
and programmatically .pastespecial in each of the ws. Am I correct?
Could you help me out with the syntax please? I am thinking a loop would
do it instead of hardcoding the open/paste/close for each ws.
something like:
For Each ws in wb
ws.activate
ws.pastespecialrange
Next ws
Thanks for your time and efforts.
Joanne
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default hide/unhide

Sub ABC()
Dim rng As Range
Set rng = Worksheets("Sheet1") _
.Range("A1").CurrentRegion
rng.Copy
For Each sh In Worksheets
If sh.Name < rng.Parent.Name Then
sh.Range("B1") _
.PasteSpecial xlValues
End If
Next
End Sub

worked fine for me with hidden columns.
Windows XP, xl2000
--
Regards,
Tom Ogilvy


"Joanne" wrote:

I am using winxp and msoffice 2003

I need to copy a named range from wbMaster to wbUser.
In wbUser many of the columns are hidden.
Do I need to unhide these columns in order to copy/pastespecial the
range from wbMaster?
Also, wbUser has several ws that need the same range copied to from the
wbMaster.
I am thinking that there must be a way to cycle thru the ws in wbUser
and programmatically .pastespecial in each of the ws. Am I correct?
Could you help me out with the syntax please? I am thinking a loop would
do it instead of hardcoding the open/paste/close for each ws.
something like:
For Each ws in wb
ws.activate
ws.pastespecialrange
Next ws
Thanks for your time and efforts.
Joanne

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default hide/unhide

Thanks Tom

Tom Ogilvy wrote:

Sub ABC()
Dim rng As Range
Set rng = Worksheets("Sheet1") _
.Range("A1").CurrentRegion
rng.Copy
For Each sh In Worksheets
If sh.Name < rng.Parent.Name Then
sh.Range("B1") _
.PasteSpecial xlValues
End If
Next
End Sub

worked fine for me with hidden columns.
Windows XP, xl2000


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
hide/unhide brownti Excel Discussion (Misc queries) 3 February 6th 07 07:14 PM
Hide/Unhide Help Danno[_7_] Excel Programming 3 July 26th 06 05:43 PM
Hide Unhide Colin Excel Discussion (Misc queries) 4 April 9th 06 05:01 PM
Hide/unhide Jock W Excel Worksheet Functions 4 October 4th 05 05:02 PM
hide/unhide heartbreakkid Excel Programming 6 May 7th 04 10:13 PM


All times are GMT +1. The time now is 10:09 PM.

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"