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

Mrsaad

New Member
Joined
Jan 22, 2014
Messages
10
[TABLE="width: 1224"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Holdings[/TD]
[TD]-[/TD]
[TD]-[/TD]
[TD]Duration[/TD]
[/TR]
[TR]
[TD]N/A[/TD]
[TD]N/A[/TD]
[TD]N/A[/TD]
[TD]Meets Expectation[/TD]
[/TR]
[TR]
[TD]N/A[/TD]
[TD] -[/TD]
[TD] -[/TD]
[TD]Meets Expectation[/TD]
[/TR]
[TR]
[TD]Meets Expectation[/TD]
[TD] -[/TD]
[TD] -[/TD]
[TD]Meets Expectation[/TD]
[/TR]
[TR]
[TD]N/A[/TD]
[TD] -[/TD]
[TD] -[/TD]
[TD]Meets Expectation[/TD]
[/TR]
</tbody>[/TABLE]

"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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
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
:rofl: 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,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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