Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fill in the blanks
Hello,
I would like to fill in the blanks cells in column A row 14 through last used row with the formula =mid(A2,2,10). Column B has last used row. Im trying unsucessfully to use something like, but it isn't filling in the blanks: Dim LastRow As Long Dim rng As Range Dim i As Long LastRow = Cells(Rows.Count, "B").End(xlUp).Row For i = 14 To cLastRow 'If Cells(i, "A").Value = "" Then Cells(i, "A").Formula = "=MID(R[-12]C[2],2,10)" ' End If Next i Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fill in the blanks
You changed a variable name (LastRow vs cLastRow) and you'd want to use
..FormulaR1C1 (not .formula) since you're creating a formula using R1C1 reference style: Dim LastRow As Long Dim rng As Range Dim i As Long LastRow = Cells(Rows.Count, "B").End(xlUp).Row For i = 14 To LastRow 'If Cells(i, "A").Value = "" Then Cells(i, "A").FormulaR1C1 = "=MID(R[-12]C[2],2,10)" ' End If Next i On 06/25/2010 10:34, wrote: Hello, I would like to fill in the blanks cells in column A row 14 through last used row with the formula =mid(A2,2,10). Column B has last used row. Im trying unsucessfully to use something like, but it isn't filling in the blanks: Dim LastRow As Long Dim rng As Range Dim i As Long LastRow = Cells(Rows.Count, "B").End(xlUp).Row For i = 14 To cLastRow 'If Cells(i, "A").Value = "" Then Cells(i, "A").Formula = "=MID(R[-12]C[2],2,10)" ' End If Next i Thank you -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Fill in Blanks | Excel Programming | |||
How to fill up blanks | Excel Discussion (Misc queries) | |||
Fill in the blanks! | Excel Programming | |||
Fill in the blanks | Excel Programming | |||
Fill in the blanks | Excel Programming |