Copy down a number of rows based on the number of populated rows on another Tab

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,341
Office Version
  1. 365
Platform
  1. Windows
I have values going down a column on a tab named "WBS" starting on B8

On another Tab named "WBS_Price_Summary" I want to put a forumula; ActiveCell.FormulaR1C1 = "=WBS!R8C2"
in B8 and copy it down the same number of populated rows on the other tab.

So if I have data in B8 through B23 on tab "WBS" I want to instert the formula above in Sheets("WBS_Price_Summary").Range("B8") and then copy the formula down to B23.

Hope that makes sense.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi,

Using the AutoFill Function.

Code:
nbData = WorksheetFunction.Count(Worksheets("WBS").Range("B8:B10000"))

Worksheets("WBS_Price_Summary").Range("B8").FormulaR1C1 = "=WBS!R8C2"

Worksheets("WBS_Price_Summary").Range("B8").AutoFill Destination:=Range("B8:B" & nbData), Type:=xlFillDefault

Hope it helps :)
 
Upvote 0
Another option
Code:
Sub chk()
Dim Usdrws As Long
Usdrws = Sheets("WBS").Range("B" & Rows.Count).End(xlUp).Row
Sheets("WBS_Price_Summary").Range("B8:B" & Usdrws).FormulaR1C1 = "=WBS!R8C2"
End Sub
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,185
Members
449,071
Latest member
cdnMech

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