Corresponding Range in another column

A

achidsey

Excel Experts,

My spreadsheet is similar to the following:

A B C D
1 Trader Action Quantity Fees
2 Bill 20
3 Bill 20
4 Steve 30
5 Steve 30

I've defined cells A2..A5 as a variable Trades
I've defined cell D1 as a variable Fees
How do I select the range D2..D5, that is, the same cells
as in Trades, but in the column where Fees is?

My code so far:

Sub Fees()

Cells.Find(What:="TraderID").Offset(1).Select
Range(Selection, Selection.End(xlDown)).Select
Set Trades = Selection

Set Fees = Cells.Find(What:="Fees")


End Sub

Thank you,
Alan
 
D

Don Guillett

something like this. untested

mc=rows(1).find("Fees").column
lr=cells(rows.count,mc).end(xlup).row
set fees=range(cells(2,mc),cells(lr,mc))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top