Created
January 27, 2025 16:55
-
-
Save ncalm/55286087975c2fc8708f7eb7cbfa3c1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub TogglePythonCells() | |
Dim cell As Range | |
For Each cell In Selection | |
If Left(cell.Formula2, 3) = "=PY" Then | |
If cell.HasFormula Then | |
cell.Formula2 = "'" & cell.Formula2 | |
Else | |
cell.Formula2 = cell.Formula2 | |
End If | |
End If | |
Next cell | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment