Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default select only used rows and only visible cells

I've used the following macro by Frank Kabel to select only usedrows
but as I'm dealing with subtotals (level 2 so only the subtotals
themselves are visible) I only want to copy the visible rows. How do I
go about doing that?

Before the Copy command I've specified -
Selection.SpecialCells(xlCellTypeVisible).Select - but it still copies
all the used rows not the visible cells only

"Sub copy_used()
Dim source As Worksheet
ActiveSheet.UsedRange.Copy
Set source = Worksheets("Sheet2")
source.Paste Destination:=source.Range("A1")
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany "

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default select only used rows and only visible cells

bump

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default select only used rows and only visible cells

I don't see where you specified just the visible cells in your code.

Rokuro kubi wrote:

I've used the following macro by Frank Kabel to select only usedrows
but as I'm dealing with subtotals (level 2 so only the subtotals
themselves are visible) I only want to copy the visible rows. How do I
go about doing that?

Before the Copy command I've specified -
Selection.SpecialCells(xlCellTypeVisible).Select - but it still copies
all the used rows not the visible cells only

"Sub copy_used()
Dim source As Worksheet
ActiveSheet.UsedRange.Copy
Set source = Worksheets("Sheet2")
source.Paste Destination:=source.Range("A1")
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany "


--

Dave Peterson
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



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