Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert VBA to Python
#4
I was going to suggest the Jobs section of the forum, but took a second look at this and it should be rather trivial. It has been a long time since I did any VBA, though. Can you tell me what the function is supposed to do?

I see a lot of problems in the VBA code so that's why I want to start with the description. It looks like you are trying to remove a particular character sequence from the string, but the coding looks like it works only in very specific situations. For example, what if the cut_2 string is found before the cut_1 string? What if you still find cut_1 in the string but there are no more cut_2's? Looks like it will error out in both situations.

It looks like you want to remove all text from the beginning of the match to cut_1 to the end of cut_2, no matter how many times these two string snips are found, but it is unPythonic to guess. So, if you can explain what the function is supposed to do I am willing to take a whack at it.
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