# Find N/A and fill same "N/A in next available blank cells

##### New Member
 Holdings - - Duration N/A N/A N/A Meets Expectation N/A - - Meets Expectation Meets Expectation - - Meets Expectation N/A - - Meets Expectation

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>

"There is N/A under Holdings and I filled N/A in next columns manually, before "Meets Expectation" column, also there are N/A below and I want them filled automatically with some VBA coding till its blank.

### Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
which columns?
starting at which row?

Means in entire sheet, if it find N/A under any header so fill N/A automatically, till next filled column.

Test on a COPY of your worksheet
Code:
``````Sub NotApplicable()
Const N = "N/A": Dim Cel As Range

For Each Cel In ActiveSheet.UsedRange
If UCase(Cel.Offset(, -1) & Cel) = N Then Cel = N
Next
End Sub``````

Perhaps too many N/A ??

Last edited:
Yes with too many N/A .. Not working

It is working!
It is not working how you want - I expected that.

Not working

That comment is not going to get us any further, so please explain what needs changing ...
- which ROW are the Headers in?
- you need to tell me when the N/A must stop based on a value in the HEADER row (or another row)

I need to give VBA a value it can look up and know to stop inserting N/A in next cell

Last edited:
yeah its not working as i want..

ok let me explain.. U see main header there "Holdings" and then next main header "Duration", i get N/A part under the main header with other part "Meet Expectations", I need to put N/A manually between "Holdings" and Duration manually (Under Sub headers), which is comes blank by default.
I want that if Excel find N/A under any main header, so it automatically put N/A under other sub headers.

Hope u get this now, I tried my best actually..

Does this macro do what you want...
Code:
``````[table="width: 500"]
[tr]
[td]Sub DistributeNAs()
Dim LastRow As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("B2:C" & LastRow) = Evaluate(Replace("IF(A2:A#=""N/A"",""N/A"",IF(B2:C#="""","""",B2:C#))", "#", LastRow))
End Sub[/td]
[/tr]
[/table]``````

Replies
0
Views
104
Replies
4
Views
121
Replies
1
Views
348
Replies
2
Views
446
Replies
3
Views
168

1,203,754
Messages
6,057,156
Members
444,908
Latest member
Jayrey

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back