Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Vba conversion to Python
#1
Hi
gentlemen is there a way to convert a VBA code to python, the code below as an example will be appreciated
Sub LotFilter()
Dim RngDelete As Range
Application.ScreenUpdating = False
For Each rw In Range("H1:M3").Rows
  ReDim matches(1 To 1)
  For Each rowe In Range("A2:F12").Rows
    x = Evaluate("SUMPRODUCT(COUNTIF(" & rw.Address & "," & rowe.Address & "))")
    If x > 3 Then
      If RngDelete Is Nothing Then
        Set RngDelete = rowe
      Else
        Set RngDelete = Union(RngDelete, rowe)
      End If
    End If
  Next rowe
Next rw
If Not RngDelete Is Nothing Then
 ' RngDelete.Select  'or one of the 2 lines below:
 'RngDelete.Delete Shift:=xlUp
 RngDelete.EntireRow.Delete
End If
Application.ScreenUpdating = True
End Sub
Regards
Reply
#2
See http://vb2py.sourceforge.net/
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I need to add data types to cython conversion python to c Good_AI_User 1 997 Aug-19-2022, 07:52 AM
Last Post: Gribouillis
  Conversion of Oracle PL/SQL(packages, functions, procedures) to python modules. DivyaKumar 2 6,488 Jul-09-2020, 04:46 PM
Last Post: srikanth7482
  C to Python code conversion print problem anakk1n 1 2,173 May-22-2020, 04:15 PM
Last Post: deanhystad
  Python uppercase conversion conditions Jaypeng 7 2,959 Apr-29-2020, 11:24 AM
Last Post: jefsummers
  MATLAB to Python conversion stokd 10 5,006 Jan-19-2020, 09:14 PM
Last Post: stokd
  Excel Model Conversion into Python line7 2 2,260 Oct-09-2019, 07:51 AM
Last Post: line7
  python opencv grayscale conversion error Spandora 1 9,568 May-26-2019, 10:43 AM
Last Post: heiner55
  Conversion of Time Duration in seconds in python jdevansh99 0 2,854 Jun-05-2018, 05:12 PM
Last Post: jdevansh99
  C++ to Python conversion Jellyboo 13 9,512 Apr-02-2017, 06:27 PM
Last Post: Jellyboo

Forum Jump:

User Panel Messages

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