Hello - have gotten some great advice from your site, so I figured I'd join and see how much more I can learn. Not a programmer, but am working on a project which requires me to do some VBA programming (via Excel 07).
I'm currently trying to find a fast way to replace every blank (empty) cell in a range with a text string "No Data Available"
My spreadsheet is over 28,000 rows, and the cells which need replacing are in columns D, E, F, and G. It's working now, but I need to try to shave off some time from the execution of the macros... any advice is greatly appreciated!
I'm currently trying to find a fast way to replace every blank (empty) cell in a range with a text string "No Data Available"
My spreadsheet is over 28,000 rows, and the cells which need replacing are in columns D, E, F, and G. It's working now, but I need to try to shave off some time from the execution of the macros... any advice is greatly appreciated!
Code:
Sub replaceblanks()
'
'Macro will replace blanks with "No Data Available"
application.calculation = xlCalculationManual
application.screenupdating = false
application.displayalerts = false
Range("D2:G28230").Select
Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.replace What:="", Replacement:="No Data Available", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Calculate
application.calculation = xlCalculationAutomatic
application.screenupdating = true
application.displayalerts = true
End Sub
Comment