Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Want to Copy and paste to new sheet range except hidden rows.

Hi,

I have a macro that copies on sheet to another and I use this to
achieve it:

Worksheets.Add
ThisWorkbook.ActiveSheet.Name = "Report"
ThisWorkbook.Sheets("WorkingSheet").Select
Range("A1:D23").Select
'Application.CutCopyMode = False
Selection.Copy

Sheets("Report").Activate
Sheets("Report").Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths,
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

The problem is that there are some Rows within the range that are
hidden and dont want to copy them to the new sheet or at least keep it
hidden as well.

Is there a way with copy/paste to ignore hidden rows or have to use
VBA to hide the rows in the new sheet as well?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Want to Copy and paste to new sheet range except hidden rows.

Try this

Worksheets.Add
ThisWorkbook.ActiveSheet.Name = "Report"
ThisWorkbook.Sheets("WorkingSheet").Select
Range("A1:D23").Select
'Application.CutCopyMode = False

' selection.copy
Selection.SpecialCells(xlCellTypeVisible).Copy

Sheets("Report").Activate
Sheets("Report").Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False



Mike

" wrote:

Hi,

I have a macro that copies on sheet to another and I use this to
achieve it:

Worksheets.Add
ThisWorkbook.ActiveSheet.Name = "Report"
ThisWorkbook.Sheets("WorkingSheet").Select
Range("A1:D23").Select
'Application.CutCopyMode = False
Selection.Copy

Sheets("Report").Activate
Sheets("Report").Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths,
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

The problem is that there are some Rows within the range that are
hidden and dont want to copy them to the new sheet or at least keep it
hidden as well.

Is there a way with copy/paste to ignore hidden rows or have to use
VBA to hide the rows in the new sheet as well?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Want to Copy and paste to new sheet range except hidden rows.

Try this code, change the ranges as per your requirement

Range("B3:B8").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Sheet2").Select
Range("I6").Select
ActiveSheet.Paste
Range("K9").Select

regards
KarthiGanesh

" wrote:

Hi,

I have a macro that copies on sheet to another and I use this to
achieve it:

Worksheets.Add
ThisWorkbook.ActiveSheet.Name = "Report"
ThisWorkbook.Sheets("WorkingSheet").Select
Range("A1:D23").Select
'Application.CutCopyMode = False
Selection.Copy

Sheets("Report").Activate
Sheets("Report").Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths,
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

The problem is that there are some Rows within the range that are
hidden and dont want to copy them to the new sheet or at least keep it
hidden as well.

Is there a way with copy/paste to ignore hidden rows or have to use
VBA to hide the rows in the new sheet as well?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Want to Copy and paste to new sheet range except hidden rows.

another way perhaps?


With ThisWorkbook
.Worksheets.Add
.ActiveSheet.Name = "Report"
.Worksheets("WorkingSheet").Range("A1:D23") _
.SpecialCells(xlCellTypeVisible).Copy
With .Worksheets("Report").Range("A1")
.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End With
End With
--
jb


" wrote:

Hi,

I have a macro that copies on sheet to another and I use this to
achieve it:

Worksheets.Add
ThisWorkbook.ActiveSheet.Name = "Report"
ThisWorkbook.Sheets("WorkingSheet").Select
Range("A1:D23").Select
'Application.CutCopyMode = False
Selection.Copy

Sheets("Report").Activate
Sheets("Report").Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths,
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

The problem is that there are some Rows within the range that are
hidden and dont want to copy them to the new sheet or at least keep it
hidden as well.

Is there a way with copy/paste to ignore hidden rows or have to use
VBA to hide the rows in the new sheet as well?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Want to Copy and paste to new sheet range except hidden rows.

Awesome,

Once again this group comes thru with the solution.

Thanks much.
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/Paste with Hidden Rows/Columns Excel 2007 Jayne Mae Excel Discussion (Misc queries) 3 January 28th 10 07:08 PM
copy/paste with hidden rows don't want hidden parts to paste robynne Excel Discussion (Misc queries) 1 September 21st 07 09:23 PM
subtotal copy-paste and delete hidden rows Winslow Excel Discussion (Misc queries) 1 December 12th 06 03:26 PM
copy a page with hidden rows and only paste what is showing wyocowboy Excel Discussion (Misc queries) 2 November 18th 06 06:44 PM
copy and paste hidden rows tracykrulich Excel Worksheet Functions 1 October 13th 05 05:11 PM


All times are GMT +1. The time now is 08:21 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"