Named Range and Indirect Formula Using Variables in Cell

helpexcel

Well-known Member
Joined
Oct 21, 2009
Messages
656
Hi - I'm looking for a formula that will look at the values in Sheet1("B3") & Sheet1("D3") to determine the starting cell to copy from Sheet2. So if B3="F" and D3="5" the starting point would be Sheet2("F5"). I then want the formula to find the last row. Can this be then be used as a named range that can be pasted to Sheet3("A3")?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
tried using code, because I'm not sure it can be done with just formulas, but my code doesn't work either.
VBA Code:
Sub Copy_Columns()

Set ws2 = Sheet2
Set ws1 = Sheet1
Set ws3 = Sheet3

Dim rowBD, colBD, rng As Range
    Set colBD = ws2.Range("B3")
    Set rowBD = ws2.Range("D3")

Dim LastRow As Long
With ws1
    LastRow = .Cells(.Rows.Count, colBD).End(xlUp).Row
    Set rng = .Range(.Cells(rowBD, colBD), .Cells(LastRow, colBD))
    rng.Copy ws3.Range("A3")
End With

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,054
Latest member
juliecooper255

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