Excel VBA If Cell in a column U is Blank, enter te

2019-06-14 04:57发布

问题:

I have an exported txt file that i am running several macros on to create an import file.

In column U, if a cell is blank i need it to enter "600SUB"

Then i need to run the rest of the macros.

Any help would be greatly appreciated.

Thanks

回答1:

Use SpecialCells to locate and fill truly blank cells.

with worksheets(1)
    on error resume next
    intersect(.usedrange, .range("U:U")).specialcells(xlcelltypeblanks) = "600SUB"
    on error goto 0
end with

'run rest of procedures