Trying to run the code below on a sheet but keep getting compile error. In bold is what is erroring (is that a real word?)
My aim is to have it so a box (5,2) has either a Y or N entry.
If it is Y then (9,8) = (10,31) on this page.....this works
Also if Y then another cell (9,3) = value in (1,1) from another page in this workbook (Main Data)
Where have I gone wrong??
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Cells(5, 2) = "N" Then
Cells(9, 8) = "0"
ElseIf Cells(5, 2) = "Y" Then
Cells(9, 8) = Cells(10, 31)
ElseIf Cells(5, 2) = "Y" Then
Worksheet("GPS Mapping").Cells(9, 3).Value = ThisWorkbook.Worksheet("Main Data").Cells(1, 1).Value
End If
End
End Sub
Bookmarks