Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Copying filtered cells from a specific location

I have a filtered sheet, and I want to copy all visible cells to another
sheet starting from cell B4 (header cell) to column E. All headers from B to
E included, and the amount of visible rows varies. From the same sheet I also
need to copy the first visible cell from column A - header not included. Area
B4 to Esomething is copied to a different location on the other sheet than
the first filtered cell from column A.

I need more brain capacity!!! :=)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Copying filtered cells from a specific location

Try this changing cell and Sheet References as needed.

Sub Test()
Dim CopyRng As Range
Dim DestCell As Range
Set DestCell = Worksheets("Sheet2").Range("A1")
iLastRow = Range("B65536").End(xlUp).Row

Set CopyRng = Range("B4:E" & iLastRow).SpecialCells(xlCellTypeVisible)
CopyRng.Copy
DestCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"kativa" wrote:

I have a filtered sheet, and I want to copy all visible cells to another
sheet starting from cell B4 (header cell) to column E. All headers from B to
E included, and the amount of visible rows varies. From the same sheet I also
need to copy the first visible cell from column A - header not included. Area
B4 to Esomething is copied to a different location on the other sheet than
the first filtered cell from column A.

I need more brain capacity!!! :=)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Copying filtered cells from a specific location

Thanks! I'm very grateful for your answer.

-Kate

"Michael" kirjoitti:

Try this changing cell and Sheet References as needed.

Sub Test()
Dim CopyRng As Range
Dim DestCell As Range
Set DestCell = Worksheets("Sheet2").Range("A1")
iLastRow = Range("B65536").End(xlUp).Row

Set CopyRng = Range("B4:E" & iLastRow).SpecialCells(xlCellTypeVisible)
CopyRng.Copy
DestCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"kativa" wrote:

I have a filtered sheet, and I want to copy all visible cells to another
sheet starting from cell B4 (header cell) to column E. All headers from B to
E included, and the amount of visible rows varies. From the same sheet I also
need to copy the first visible cell from column A - header not included. Area
B4 to Esomething is copied to a different location on the other sheet than
the first filtered cell from column A.

I need more brain capacity!!! :=)

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
Copying four filtered cells CousinExcel Excel Discussion (Misc queries) 1 January 15th 10 04:14 PM
Copying filtered four cells by means of macro CousinExcel Excel Discussion (Misc queries) 4 January 15th 10 03:33 PM
Copying a cell value to a specific cells MJKelly Excel Programming 1 March 16th 08 12:07 AM
Copying specific cells from a sheet to another Catalin Excel Discussion (Misc queries) 1 July 28th 06 11:59 PM
Copy Specific Cells depending upon cursor location in Excel REVA Excel Programming 1 January 4th 06 07:01 PM


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