Fin End of Used Range

R

ryguy7272

I’m playing around with the code below, to try to get cells A2:A to fill, but
I can’t get it working. Now I have this:

Last = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
Range("A" & Last).Select
Range(Selection, Cells(1)).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"

I’m trying to fill in all blanks, between A2 and the end of the used range,
with the value in the cells above (basically Ctrl+g, Special, Blanks, =, up
arrow, ctrl+Enter). I can’t find the end of the used range. Can someone
please offer some assistance?

Alternatively, I was considering finding the cell address of the last used
cell in Column A, and using that in a macro. Perhaps something like:

'J1 contains a function that finds the cell address of the last nonblank
cell...
Last = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
Range("A" & J1).Select
Range(Selection, Cells(1)).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"


Any ideas on this?




Cordially,
Ryan---
 
B

Bob Phillips

Last = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
Range("A1:A" & Last).SpecialCells(xlCellTypeBlanks).FormulaR1C1 =
"=R[-1]C"


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
R

ryguy7272

Awesome!! Thanks for getting me over the hurdle Bob!
Cordially,
Ryan---

--
RyGuy


Bob Phillips said:
Last = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
Range("A1:A" & Last).SpecialCells(xlCellTypeBlanks).FormulaR1C1 =
"=R[-1]C"


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



ryguy7272 said:
I'm playing around with the code below, to try to get cells A2:A to fill,
but
I can't get it working. Now I have this:

Last = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
Range("A" & Last).Select
Range(Selection, Cells(1)).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"

I'm trying to fill in all blanks, between A2 and the end of the used
range,
with the value in the cells above (basically Ctrl+g, Special, Blanks, =,
up
arrow, ctrl+Enter). I can't find the end of the used range. Can someone
please offer some assistance?

Alternatively, I was considering finding the cell address of the last used
cell in Column A, and using that in a macro. Perhaps something like:

'J1 contains a function that finds the cell address of the last nonblank
cell...
Last = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Select
Range("A" & J1).Select
Range(Selection, Cells(1)).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"


Any ideas on this?




Cordially,
Ryan---
 

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