Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 90218

VBA Function to fill empty cells with last non empty value

$
0
0

I'm trying to develop a simple code to fill empty cells with the last non empty cell as shown in the image:

enter image description here

Function FILL(x, y)

If Not IsEmpty(y) Then

FILL = y

Else

FILL = ActiveSheet.ActiveCell.Column.End(xlUp).Select.Value

End If

End Function

The code above return #VALUE! on the empty cells instead.


Viewing all articles
Browse latest Browse all 90218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>