Last Question for the day

Parra

Well-known Member
Joined
Feb 21, 2002
Messages
752
I have a formula in Column R Row 2 that I want to have scrolled down till the end of column B.

Ex. Col.B ends at row 200, I want the macro to click and drag the formula till row 200.


I can't figure it out?

Any suggestions, Thanks
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
You want r2:b200 filled, 'cause that is:

Code:
Sub cpier()
[r2].Copy [b2:r200]
End Sub

Doesn't seem like that's what you would want though....

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
This message was edited by NateO on 2002-04-26 16:20
 
Upvote 0
I'm not clear on what you need? Do you want
the formula that resides in R2 copied from
B2:B200?

James
 
Upvote 0
If it's b2:b200 then:

Code:
Sub cpier()
[r2].Copy [b2:b200]
End Sub

Must be off. Hope this helps.
 
Upvote 0
Yes, what I need is the formula in R2 to be clicked and dragged. But to stop at the same row column B ends. Thanks
 
Upvote 0
The thing is the range changes. Depending on the number of rows in column B. So it could be 5, 100 or 15000.
 
Upvote 0
Hi,

If column B is variable in length, then try,

Sub test()
Dim lastrow As Long

lastrow = Cells(Rows.Count, 2).End(xlUp).Row
Range("R2").Copy Range("R3:R" & lastrow)

End Sub

Also, to prevent the formula in cell R2 from accidentally being deleted, load that at run time as well.

Range("R2:R" & lastrow) = "=10*ROW()"
for example.

Bye,
Jay
 
Upvote 0
YES!!!!! Now I can go and have a beer. Jay if you were around I would get you one. Thanks, that did the job and I am done for the week.

Parra
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,168
Members
448,870
Latest member
max_pedreira

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