Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Paste All but Hidden Data?


I've been trying to write a macro to copy and paste data from a column
in one spreadsheet over to a column in another spreadsheet. The
problem is that the first spreadsheet has several hidden rows of data
that I do not need in the second spreadsheet scattered within. Is
there a way to copy and paste just the data that is not hidden? Any
help would be appreciated. Thanks.


--
sefus12
------------------------------------------------------------------------
sefus12's Profile: http://www.excelforum.com/member.php...o&userid=32755
View this thread: http://www.excelforum.com/showthread...hreadid=525853

  #2   Report Post  
Posted to microsoft.public.excel.programming
N10 N10 is offline
external usenet poster
 
Posts: 141
Default Paste All but Hidden Data?



Sub copyvisiblecells ()

Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
ActiveSheet.Paste

end sub

This should get you started, substitue your own ranges and sheet names.

The key line of code is

Selection.SpecialCells(xlCellTypeVisible).Select

Best N10

"sefus12"

wrote in message
...

I've been trying to write a macro to copy and paste data from a column
in one spreadsheet over to a column in another spreadsheet. The
problem is that the first spreadsheet has several hidden rows of data
that I do not need in the second spreadsheet scattered within. Is
there a way to copy and paste just the data that is not hidden? Any
help would be appreciated. Thanks.


--
sefus12
------------------------------------------------------------------------
sefus12's Profile:
http://www.excelforum.com/member.php...o&userid=32755
View this thread: http://www.excelforum.com/showthread...hreadid=525853



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default Paste All but Hidden Data?

Hi ....,

To eliminate hidden rows when copying, you can use the keyword shortcut
Ctrl+A to select all cells (slam the keys again if using Excel 2003)
Alt+; (semi-colon) to select visible cells
Ctrl+C to copy the selection
select new sheet
Ctrl+V to paste the selection (without the hidden rows)

If you still need a macro, see what happens if you do the above while recording
a macro.

BTW,
If you used a Filter you would only be copying the rows that are unfiltered.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"sefus12" wrote in message
...

I've been trying to write a macro to copy and paste data from a column
in one spreadsheet over to a column in another spreadsheet. The
problem is that the first spreadsheet has several hidden rows of data
that I do not need in the second spreadsheet scattered within. Is
there a way to copy and paste just the data that is not hidden? Any
help would be appreciated. Thanks.


--
sefus12
------------------------------------------------------------------------
sefus12's Profile: http://www.excelforum.com/member.php...o&userid=32755
View this thread: http://www.excelforum.com/showthread...hreadid=525853



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
copy and paste range of cells excluding hidden data in excel Steve22055 Excel Discussion (Misc queries) 3 October 23rd 08 01:57 PM
paste data over hidden cells that are filtered derwood[_2_] Excel Worksheet Functions 1 March 9th 08 02:11 AM
copy/paste with hidden rows don't want hidden parts to paste robynne Excel Discussion (Misc queries) 1 September 21st 07 09:23 PM
How to paste data over the hidden rows in a sheet with a filter hezemeftez Excel Discussion (Misc queries) 2 August 2nd 06 03:29 PM
Can I paste data skipping the hidden cells ? tclark67 Excel Discussion (Misc queries) 3 August 22nd 05 07:04 PM


All times are GMT +1. The time now is 11:36 AM.

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"