Je suis Français et n’ai pas trouvé ce forum dans ma langue natale…
Pardon donc, je vais utiliser abondamment Google Traduction…
====
Hello,
I am French and did not find this forum in my native language…
Sorry, I’m going to use Google Translate a lot…
I am a new user of OnlyOffice, have very little experience with Javascript, having worked so far in VBA.
I am looking today on a spreadsheet, to prohibit writing in specific ranges according to the following logic:
On each row containing 6 rows, only one column A or column B or column D or column E can be filled at a time.
Any second writing on the same line must be prohibited.
Even more precision : column A or B AND not D and not E or column D or E AND not A and not B…
a table :
… Have you have some adaptable examples.
Thank you !
Best regards.
Sorry for the late reply.
Unfortunately, we do not have examples of it. But if you share the VBA code that you have used with us then we can help you to adapt it.
Private Sub Worksheet_selectionChange(ByVal Target As Range)
'Application.EnableEvents = False
If Target.Row > 1 And Target.Row < 379 Then
With ActiveSheet
Select Case Target.Column
Case 3, 4
If .Cells(Target.Row, 1) <> "" Or .Cells(Target.Row, 2) <> "" Then
Rep = MsgBox("MAUVAIS POINTAGE," & Chr(10) & Chr(10) & "LE MOUVEMENT DU JOUR NE PEUT ETRE QUE D'UNE SEULE PERSONNE ...", vbOKOnly + vbExclamation, "ERREUR !")
.Range("A1").Select
End If
Case 1, 2
If .Cells(Target.Row, 3) <> "" Or .Cells(Target.Row, 4) <> "" Then
MsgBox "ERREUR ! Le mouvement du jour ne peut etre que d'une seule personne !"
.Range("A1").Select
End If
End Select
End With
End If
'Application.EnableEvents = True
End Sub
Unfortunately, I have to inform you that right now it is impossible to make such macro work because it requires an event that looks for the selection of the cell to attach data to it. We do not have such events so we created a suggestion to add number 61131.