Forum Discussion

Excel's avatar
Excel
Iron Contributor
Aug 05, 2021
Solved

VBA code for blank cells

Hello Everyone,

I am trying to fill all the blank cells with "UNASSIGNED CUSTOMER" string. The problem i am facing is specifying the range of the loop that i want to run.

Since I want to make this as dynamic as possible.

I tried this code, but not working - 

 

Dim valueCells As Range

Dim valueRange As Range

set valueRange =

For Each valueCells In valueRange

If VBA.IsEmpty(valueCells.Value) = True Then

valueCells.Value = "Customer Unassigned"

End If

Next

 

Can you please help me out with the range here?

 

--Or--

 

What should i write in VBA code?

 

Please help..??

 

Here is a attached file..

4 Replies

Resources