doubt in code line

GirishDhruva

Active Member
Joined
Mar 26, 2019
Messages
308
Can someone explain me What the below line is ....
" Fnd.Offset(1).Resize(sh.Cells(Rows.Count, Fnd.Column).End(xlUp).Row, 1).Copy"

Thank you in advance
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Can someone explain me What the below line is ....
" Fnd.Offset(1).Resize(sh.Cells(Rows.Count, Fnd.Column).End(xlUp).Row, 1).Copy"

Thank you in advance

Fnd is a range object...maybe a cell
sh is the worksheet in which Fnd resides
The code selects from one row below Fnd down to the last populated cell in the column containing Fnd and places it to the clipboard to copy elsewhere.
This line of code would be followed by a line to paste the data.
 
Upvote 0
down to the last populated cell in the column containing Fnd
Not quite true... because it is using resize by the row number of the last cell in the Fnd.column then if the Fnd is...

in Row 1 then with the Offset(1) it will copy the range to 1 row below the last row.
in Row 2 then with the Offset(1) it will copy the range to 2 rows below the last row.
in Row 3 then with the Offset(1) it will copy the range to 3 rows below the last row.

et cetera.

I assume by the OP's other thread that Fnd is in row 1 so it will copy from row 2 to 1 row below the last row.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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