ONLYOFFICE Workspace 12.5: enhanced security, optimized document management, Dark theme, and more
ONLYOFFICE Workspace 12.5 released

Autorisation ecriture dans cellule sheet (Write permission in sheet cell)


Je suis Français et n’ai pas trouvé ce forum dans ma langue natale…

Pardon donc, je vais utiliser abondamment Google Traduction…

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.

Hello @Max

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.

Hello Constantine,

Thank you for your reply.

Below is my working code in VBA…

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 !")
                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 !"
                End If
        End Select
    End With
End If

'Application.EnableEvents = True

End Sub

Thanks for providing the VBA macro.
We are checking it, I will inform you when I get any results.

Hello again @Max

Sorry for the delayed response.

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.