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

Mrsaad

New Member
Joined
Jan 22, 2014
Messages
10
Holdings--Duration
N/AN/AN/AMeets 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.

Thanks in Advance :biggrin:
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
which columns?
starting at which row?
 
Upvote 0
Means in entire sheet, if it find N/A under any header so fill N/A automatically, till next filled column.
 
Upvote 0
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 ?? :confused:
 
Last edited:
Upvote 0
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:
Upvote 0
:ROFLMAO: 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.. :cool:
 
Upvote 0
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]
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,454
Members
449,083
Latest member
Ava19

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top