copy paste only visible rows and columns

  • Thread starter Thread starter Alain
  • Start date Start date
A

Alain

It is probably basic In Excel and VBA but...
For example, I have data in a rectangular range A1..C3
A B C
1 1 2 3
2 4 5 6
3 7 8 9
I hide column B, and row 2
A C
1 1 3
3 7 9
I would like to copy and paste this range in another worksheet, and ge
just visible cells A1,C1, A3,C3 (
A B <- no more hidden rows or columns
1 1 3
2 7 9
In other words, how can I limit the copy paste process only to visibl
cells ?
Thank you for you help
Alai
 
Hi Alain

Sub TryMe()
Sheet1.Range("A1:C3").SpecialCells(xlCellTypeVisible).Copy _
Destination:=Sheet2.Range("A1")
End Sub

Or, in Excel slect the range.
Push F5
Click Special
Check Visible Cells
Click OK
Copy

***** Posted via: http://www.ozgrid.com
Excel Templates, Training & Add-ins.
Free Excel Forum http://www.ozgrid.com/forum *****
 
I do not see the equivalent of VBA SpecialCells in the Excel menus. Am
wrong ?

Alain
(I use Excel 2000, french version
 
I goofed, Dave gave me the right answer for Excel, I did not go fa
enough in the menus... Excel is really a clever program,... and yo
know it very well !

Alai
 
Back
Top