Hello,
I need a slight mod to the below code which works perfectly otherwise. What it does is it divides whatever is in column K by 30 and puts in its relative cell in column M( There a bunch of mini tables below each other with blank rows in between). The thing is sometimes there are characters in column K like "N/A" for instance and the macro crashes since its only designed to take into account numerical and blank cells in column K. Any help in tweaking the below code is much appreciated..
Sub InsertFormulas()
Dim Wks As Worksheet
Dim rngRolls As Range, Cell As Range
Dim lngRow As Long
Application.ScreenUpdating = False
For Each Wks In ThisWorkbook.Worksheets
lngRow = Wks.Range("K" & Rows.Count).End(xlUp).Row
Set rngRolls = Wks.Range("M6:M" & lngRow)
For Each Cell In rngRolls
If Not IsEmpty(Cell.Offset(0, -2)) And Not Cell = "Rolls" And _
(IsEmpty(Cell) Or IsNumeric(Cell)) Then _
Cell = Cell.Offset(0, -2) / 30
Next Cell
Next Wks
Application.ScreenUpdating = True
End Sub
Bookmarks