Chucky3006
New Member
- Joined
- Jun 20, 2017
- Messages
- 11
Good day
Is there anyone that can assist.....
I managed to get the code working for single cells but unable to get the code working for multiple cells.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A6") = "" Then
Range("A6") = "=A1"
ElseIf Range("A1") = "" Then
Range("A6") = Me.Range("A6").Value
ElseIf Range("A1") = "NDO" Then
Range("A6") = Me.Range("A6").Value
ElseIf Range("A1") = "NDO" Then
Range("A6") = "NDO"
ElseIf Range("A1") = "" Then
Range("A6") = ""
End If
End Sub
Bassically what i think it should look like is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A6:F6") = "" Then
Range("A6:F6") = Range("A1:F1")
ElseIf Range("A1:F1") = "" Then
Range("A6:F6") = Me.Range("A6:F6").Value
ElseIf Range("A1:F1") = "NDO" Then
Range("A6:F6") = Me.Range("A6:F6").Value
ElseIf Range("A1:F1") = "NDO" Then
Range("A6:F6") = "NDO"
ElseIf Range("A1:F1") = "" Then
Range("A6:F6") = ""
End If
End Sub
But this obviously is not the case.
Is there anyone that can assist.....
I managed to get the code working for single cells but unable to get the code working for multiple cells.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A6") = "" Then
Range("A6") = "=A1"
ElseIf Range("A1") = "" Then
Range("A6") = Me.Range("A6").Value
ElseIf Range("A1") = "NDO" Then
Range("A6") = Me.Range("A6").Value
ElseIf Range("A1") = "NDO" Then
Range("A6") = "NDO"
ElseIf Range("A1") = "" Then
Range("A6") = ""
End If
End Sub
Bassically what i think it should look like is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A6:F6") = "" Then
Range("A6:F6") = Range("A1:F1")
ElseIf Range("A1:F1") = "" Then
Range("A6:F6") = Me.Range("A6:F6").Value
ElseIf Range("A1:F1") = "NDO" Then
Range("A6:F6") = Me.Range("A6:F6").Value
ElseIf Range("A1:F1") = "NDO" Then
Range("A6:F6") = "NDO"
ElseIf Range("A1:F1") = "" Then
Range("A6:F6") = ""
End If
End Sub
But this obviously is not the case.