Finding Yes and No valves and pasting them

AK_Excel_13

New Member
Joined
Jul 11, 2014
Messages
30
The first column in my spreadsheet has four different types of values
"yes" , "no" , "see above" & "" (blank values)

I would like excel to look at the first column and find values that say "see above". Then I want it to look at the cells above it and copy the first "yes" or "no" that it finds and paste it in the "see above" see. I'm not sure how to do this because there are random blanks in between the "yes" "no" & the "see above" values.

Here is the code that I have so far.

Sub yes_no()


For i = 2 To 1000


If Cells(i, 1).Value = "see above" Then


Next i


End Sub

Thanks!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Welcome to the board!

Try this:
Code:
Sub yes_no()

    Dim i As Long
    Dim x As Long
    
    For i = 2 To 1000
        x = 1
        If Cells(i, 1).Value = "see above" Then
            Do Until Cells(i, 1).Offset(-x, 0) = "yes" Or Cells(i, 1).Offset(-x, 0) = "no"
                x = x + 1
            Loop
        Cells(i, 1) = Cells(i, 1).Offset(-x, 0)
        End If
    Next i

End Sub
 
Upvote 0
You can also use this.

Code:
Sub Macro1()
    Range("A:A").Replace "see above", "=VLOOKUP(REPT(""z"",50),INDIRECT(""A2:A"" & Row()-1),1)"
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,665
Members
449,091
Latest member
peppernaut

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