get visible cells range to another range

Jimijames

New Member
Joined
Sep 18, 2013
Messages
3
Dears,

First of all thank You for Your help I got from You till now (i have been visiting this forum since a long time but registered only now as i am unable to solve one problem). !


Here is my question to You.

I have some data in Range("F1:J364"), it is filtered (i exclude all #N/A`s) - for now lets say selection is ("F1:J16,F20:J36,F40:J130")
I would like to have this filtered data in another place which is Sheet1 - data should start in Range("A1")
(I do not want to use, select and paste as this makes my code run slowly)

Here is what i came up with but is only pastes data to first hidden row so I get data only for Range("F1:J16") rest comes up as #N/A.

........
Dim Rng As Range
Set Rng = Selection.SpecialCells(xlCellTypeVisible)

Sheets("Sheet1").Select
Range("A1:E364") = Rng.Value


Also I know that if selection will be less than 364 tan remaining cell will be #N/A - but i believe i can overcome this on my own
.
Kindly asking for Your help.

THank You
Michal
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Dear Andrew,

I am so glad to see You answering to my question for the firs time :) Thanks

As i wrote i do not want to use copy paste as this slows my code down.
I had it that way but when I got a piece of data using below code, which is working fine, I was nicely surprised by speed increase:

Set Rng1 = Range("D1:E3")
Range("A1:B3") = Rng1.Value

Destination is in another Workbook and this workbook is an attachement to e-mail message.
I am looking for any speed-up posibilities and this one looks promissing.
But any other fast solution would be good.

Kind regards
Michal
 
Upvote 0

Forum statistics

Threads
1,216,082
Messages
6,128,702
Members
449,464
Latest member
againofsoul

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top