I
inquirer
Can I use named ranges to make my code easier to follow?
What I would like to do is something like this:
rnage("a1").select
lastrow=Range(Selection, Selection.End(xlDown)).Cells.Count
name cells A2 to Alastrow as price
name cells B2 to Blastrow as quantity
name cells C2 to Clastrow as cost
for i=2 to lastrow
cost(i)=price(i)*quantity(i)
next i
This is more meaningful than
cells(i,"c").value=cells(i,"a").value*cells(i,"b").value
Or is there a better and clearer way to do this?
Thanks
Chris
What I would like to do is something like this:
rnage("a1").select
lastrow=Range(Selection, Selection.End(xlDown)).Cells.Count
name cells A2 to Alastrow as price
name cells B2 to Blastrow as quantity
name cells C2 to Clastrow as cost
for i=2 to lastrow
cost(i)=price(i)*quantity(i)
next i
This is more meaningful than
cells(i,"c").value=cells(i,"a").value*cells(i,"b").value
Or is there a better and clearer way to do this?
Thanks
Chris