PC Review


Reply
Thread Tools Rate Thread

Copying filtered cells from a specific location

 
 
kativa
Guest
Posts: n/a
 
      3rd Apr 2008
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 With Quote
 
 
 
 
Michael
Guest
Posts: n/a
 
      3rd Apr 2008
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 With Quote
 
kativa
Guest
Posts: n/a
 
      4th Apr 2008
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying four filtered cells CousinExcel Microsoft Excel Misc 1 15th Jan 2010 04:14 PM
Copying filtered four cells by means of macro CousinExcel Microsoft Excel Misc 4 15th Jan 2010 03:33 PM
Copying into Filtered cells =?Utf-8?B?U25hcmE=?= Microsoft Excel Discussion 3 28th May 2007 06:03 PM
Copying the back-end to specific location. =?Utf-8?B?SmFtZXM=?= Microsoft Access Form Coding 0 12th Mar 2005 04:49 PM
Copying filtered, merged cells bennerob Microsoft Excel Worksheet Functions 1 15th Jul 2003 03:32 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:26 AM.