It finds all areas separated by a blank row and the adds the formula.
I've added some comments in the code.
If you need more help, try using the F1 key (help) on the keywords such as .Address, .SpecialCells, etc...
Sub test()
Dim rg As Range, c As Range
' Columns(1).SpecialCells(2, 1).Areas
' In column 1, find all areas that contain cells that are constants (2) and numbers (1) only
' Loop through each area (rg) of the areas found
For Each rg In Columns(1).SpecialCells(2, 1).Areas
'for each cell (c) in the range area (rg)
For Each c In rg
With c
'offset 1 column formula = adress of the cells (rows and columns relative (0) and divide by
' the last cell in the area (rg.cells(rg.rows.count) (rows and columns absolute (1 per default))
.Offset(0, 1).Formula = "=" & .Address(0, 0) & "/" & rg.Cells(rg.Rows.Count).Address
End With
Next c
Next rg
End Sub
Bookmarks