Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert VBA to Python
#1
Please could someone convert the code below for me?
I need to convert VBA to Python

=================================================================================

Public Function Clean_Text(main_text As String, _
                       cut_1 As String, _
                       cut_2 As String)
    
    Application.ScreenUpdating = False
    
    Dim x As String
    Dim begin As String
    Dim end As String
    
    x = main_text 
    
    Do While InStr(1, x, cut_1) > 0
    
        begin = InStr(1, x, cut_1)
        end = InStr(1, x, cut_2)
        x = Replace(x, Mid(x, begin, end - begin + Len(cut_2)), "")
        
    Loop
        
    Clean_Text = x
        
End Function
=================================================================================
Reply


Messages In This Thread
Convert VBA to Python - by uservaf - Sep-13-2019, 03:18 PM
RE: Convert VBA to Python - by ichabod801 - Sep-13-2019, 03:29 PM
RE: Convert VBA to Python - by uservaf - Sep-13-2019, 03:33 PM
RE: Convert VBA to Python - by jefsummers - Sep-13-2019, 08:20 PM
RE: Convert VBA to Python - by uservaf - Sep-13-2019, 09:06 PM
RE: Convert VBA to Python - by jefsummers - Sep-13-2019, 10:13 PM
RE: Convert VBA to Python - by uservaf - Sep-14-2019, 07:06 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020