I need the expert help. I wanted to fill the Formula for whole column ("D") based on other column 'C' value start from 2nd row.
Formula is " =IF(ISBLANK(C2),"Still open",TEXT(C2,"mmm")) "
I have tried as below but But its fill down the bottom of the column irrespective of the No data on dependent column. If 'C' Column have 50 records. I wanted to fill till last valid row 50 (Example : no data in column 'C' after 50 row but column D fill row no 1048576) of the table
Dim Output_Sh As Worksheet
Set Output_Sh = ThisWorkbook.Sheets("Output")
Output_Sh.Range("D1").Value = "Month Closed" ' Heading
Set Rng = Output_Sh.Range("D2:D" & Output_Sh.Range("C2").End(xlDown).Row)
Rng.FormulaR1C1 = "=IF(ISBLANK(C2),""Still open"",TEXT(C2,""mmm""))"
HI, quick update :
I have tried the formola on colmn D then it's working fine. When I want to apply on Column "AK" then its populate only 1st two row.
Sub InsertAK()
Dim n As Integer
Dim Output_Sh As Worksheet
Dim Rng As Range
Set Output_Sh = ThisWorkbook.Sheets("Output")
Output_Sh.Columns("AK:AK").Insert
Output_Sh.Range("AK1").Value = "Month Closed"
Output_Sh.Range("AK2").Value = "=IF(ISBLANK(C2),""Still open"",TEXT(C2,""mmm""))" ' "Month Closed"
Set Rng = Output_Sh.Cells.Find("*", , , , , xlPrevious)
Output_Sh.Range("AK3:AK" & Rng.Row).FormulaR1C1 = "=IF(ISBLANK(C3),""Still open"",TEXT(C3,""mmm""))"
End Sub