If "yes" then move to next cell, "no" then move to cell in next row

CWelfley01

New Member
Joined
Oct 25, 2017
Messages
11
IF "YES" THEN MOVE TO NEXT CELL, "NO" THEN MOVE TO CELL IN NEXT ROW

Title says it all. I want to have a cell in the middle of my row that will decide if i move to the next cell in the same row or go back to the start of the next row. Any help is appreciated!! I have never even accessed VBA so please keep me in the function area.
Thanks in advance!!!
 
yes sir you are correct. i have the columns i don't want to use locked and the ones i'm using unlocked, no password.
 
Upvote 0

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.
Did the last macro I suggested work for you? You placed the macro in the Worksheet code module?
 
Last edited:
Upvote 0
I tried it on a dummy sheet and it worked properly. Can you upload a copy of your file to a free site such as www.dropbox.com, mark it for sharing and post a link to the file here?
 
Upvote 0
The problem was that you were typing the Yes/No all in capital letters and macro has them as Yes/No. Try this version of the macro. I've added a line at the top to make your entry case insensitive.
Code:
Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("L:L")) Is Nothing Then Exit Sub
    ActiveSheet.Unprotect
    If Target = "Yes" Then
        Target.Offset(0, 1).Select
    ElseIf Target = "No" Then
        Cells(Target.Row + 1, 4).Select
    End If
    ActiveSheet.Protect
End Sub
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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