Need to make a macro in excel that finds blanks in a column, and then fills in the value from above the blank cell. Picture included to illustrate

一笑奈何 提交于 2019-11-29 17:37:44

try,

sub fillblankfromabove()
    dim blnks as range
    with worksheets("Sheet1").Columns("E").Cells
        set blnks = .specialcells(xlcelltypeblanks)
        if not blnks is nothing then
            blnks.formular1c1 = "=r[-1]c"
        end if
        .value = .value
    end with
end sub

Another way to do this is to select all cells that you want included in this process, press CTRL + G, select Special, then select 'Blank Cells'. This will select all blank cells within your selected range. Then enter =[cell above] and press CTRL + ENTER and it will enter that formula into all selected cells.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!