+ Reply to Thread
Results 1 to 27 of 27

vba macro to Remove Specific Text From Cell | to produce formated text.

  1. #1
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    vba macro to Remove Specific Text From Cell | to produce formated text.

    vba macro to Remove Specific Text From Cell, to produce formated text, and only 1 entry per Game as you can see in column D for entry as you see row 2 & 3 shows #2 entrys
    and in column M:U shows sample of how i would want macro to produce from column Start Time to Prize,
    would be great maybe if macro can add the Rank finished in 1st re-entry in this case row 2 cell J2 is 132nd, and in cell T2 shows only rank for second re-entry would like to have both to show this way 132|504 in Rank column

    please feel free to ask any questions you may have.

    note: in tournaments sample File, I am using formulas to produce as , I want macro to produce from column M: U
    in file 7-31-24 I enter games in Tournament sheet, as i download from poker client. columns G:O
    Zip file is original format when downloaded from client. not sure if this would help, Only that here is not duplicating the games as per re-entrys as it is in the file tournaments sample.
    2nd sample format download using google extention from client.
    I am trying to provide different type of file format to see which is easier to write macro, without having to a very long code.
    Please ask question as maybe there is an easier way.
    Last edited by west123; 07-31-2024 at 08:32 PM.

  2. #2
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    this is just a picture of the client results just to have an idea of how things are. just trying see if there is an easier way to do this with more sample options to see which file is easier to work with.
    Attached Images Attached Images

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,001

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    I included My Prop Bets in file 7.31.24 Tournaments. bit adjustment I highlighted in Yellow in column F12 to have macro remove:
    • Last Longer in column F
    • HostplankctonBet Amount$24 in column I12


    Modify MAIN:
    Please Login or Register  to view this content.
    At the bottom of the module, below the BattleR macro, add:
    Please Login or Register  to view this content.
    Ben Van Johnson

  4. #4
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    I try the following steps from above. change the macro code to this

    Please Login or Register  to view this content.
    Ben Van Johnson

    I get this error
    Wrong number of arguments or invalid property assignment
    In this file i Re-enter entries ready to run to test macro
    when I remove the leading apostrophe macro won't run. if, i put apostrophe back it runs the macro but not clearing the yellow format in column F & I in my prop bets sheet., everything else work just fine.
    Attached Files Attached Files
    Last edited by AliGW; 08-02-2024 at 12:45 PM. Reason: Code tags added - please review the forum guidelines.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    Pleaes review the forum guidleines on code tags and use them in your posts in future, please. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,001

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    Sorry, the first line for the propbets macro is:

    Sub PropBets(ByVal ShName As String)
    not
    Sub PropBets() '(ByVal ShName As String)
    Last edited by protonLeah; 08-02-2024 at 03:01 PM.

  7. #7
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    protonLeah thank you
    I just made the changed and it runs the macro code. but, it not clearing this part in yeellow in prop bets
    Attached Images Attached Images
    Last edited by west123; 08-02-2024 at 04:54 PM.

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,001

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    Well, The macro is using the highest number in column A to determine the last row. You have #sess as 0 & 1 vs 1 & 2, so the number 1 in A12 is telling the macro that you only have one data row (i.e., row 11) which is #sess 0 and blank in columns F & I. Will A11 always be zero? In some of your original sample files several sheets had columns with several thousand rows of formulas even though there were only a few rows of actual data; and it was hard to find the actual used rows with VBA except by the numbers in column A. For the case of the attachment, the macro operated on one row (11, sess 0) which was blank. If you are always going to have sess #0 for this sheet, I can modify the first and last row calculation.

  9. #9
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    thank you protonLeah
    Before we modify the code. question?s
    1. is that alot of work to modify code?, What if we have like other sheets like spinGo, BatRo and my staking?
    2.? or if I modify the sheets spinGo, BatRo and my staking? to be like My Prop Bets and add a Zer0 to column in row 11?
    which is best to go with? without having to write a longer code or do much work to make it work? please advice.
    Last edited by west123; 08-02-2024 at 08:00 PM.

  10. #10
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,001

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    This should fix PropBets with Zero as first data row
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    thank you ProtonLeah
    I will make the change now. ty
    do i just replace the end part of prop bets with this code ?
    after making the changed and ran code seems to do the same all other sheets update but not my prop bets sheet.
    wow Thank you protonLeah, and God for helping me remove the ' in order for code to work. I nailed it. I got lucky on this one.

    Please help with other 2 sheets all-in or fold & rush & cash only Start Time for all-in-or fold and Rush & cash only Start Time
    All-in-or Fold column E & column E for rush & cash they both show double time.

    Plesse Note: In this file macro formats all the folowing sheets. SpinGo, Bat Ro, My staking and Myprop Bets.
    only needed Start Time for all-in or fold & rush & cash. as the button i was using before is no longer available.
    please, as I want to move to phase 2 of breaking file as is to many sheets.
    Attached Files Attached Files
    Last edited by west123; 08-02-2024 at 10:42 PM.

  12. #12
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    GG Original download file
    in the Tournaments sheet rows 14:19 show 6 entries with only 3 cashed money 15,16, and 19
    with Total of $1.24
    In the sample sheet, I left only 1 row with the lowest in Rank and total amt. of all 3 cashes
    from the tournament sheet to a total of $1.24 which I would like the VBA code to produce, for
    the rest of the rows and, for column O with only the Rank if no $ won to be 0 I manually enter zero amt. for cells 15:22 since it was showing the rank

    protonLeah
    please help with the VBA to complete this sheet, which is the most important sheet in the book. please let me know if you have any questions.
    all other sheets after running the Main VBA it works as it should, Thank you is fantastic, I mean awesome how it works but I would like the tournament sheet to be added.

    Would like to mention that I forgot to edit the tournament's name in column H in the sample file. I added it in this file. as shown in this picture.
    I edited row 12:20 only to show the name I would like the VBA to produce.tourny name.png
    Attached Files Attached Files
    Last edited by west123; 09-29-2024 at 11:09 PM.

  13. #13
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,001

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    Code for tournament sheet
    Please Login or Register  to view this content.
    Modify MAIN:
    Please Login or Register  to view this content.

  14. #14
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,001

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    deleted.....

  15. #15
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    thank you ProntonLeah
    can you help me complete the step to apply it to the main
    I paste it to the bottom of the code. I just don't know where I input this
    Case Is = "Tournaments"
    Call Tournaments(Sht.Name)
    not sure where the above 2 lines go i paste as shown in picture. at top of code, when i run i get run time errror
    Attached Images Attached Images
    Last edited by west123; 10-06-2024 at 06:38 PM.

  16. #16
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,001

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    I notice that you remove the indentations in the code. That makes it very hard to read, especially for anyone seeing it for the first time. It obscures the block and loop structures. Hard to tell which END IF goes with which IF, which NEXT with which FOR...

    At the top of the MAIN module you have:
    ShNames = Array("spin & gold", "...
    you have to add "tournaments" to the list inside the parentheses.

  17. #17
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    can you please help on doing it.
    not sure of what exact i need to do let me look and try
    like that ?
    Attached Images Attached Images
    Last edited by west123; 10-06-2024 at 06:55 PM.

  18. #18
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    not sure this is working something is still wrong. this is what i have.
    I paste in this file when i Run main i get run-time error '5': Invalid procedure call or argument
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by west123; 10-06-2024 at 07:32 PM.

  19. #19
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,001

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    Spelling error.
    Change:
    Sub Tournaments(ByVal shtName As String)
    to:
    Sub Tournaments(ByVal shName As String)

    delete the 't'

  20. #20
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    I made the above changes and still get a run time error. I'm not sure what else is missing.
    I even remove t as shown in the picture from
    Call Tournaments (Sh.Name) no luck
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by west123; 10-07-2024 at 12:03 PM.

  21. #21
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    13,001

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    Sorry,
    should be lower case 't':
    Case Is = "tournaments"
    Call Tournaments(Sht.Name)

  22. #22
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    thank you,
    but not sure that is working either.
    Attached Images Attached Images

  23. #23
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    I tried re-entering all stats again and running vba code, which doesn't work.

  24. #24
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    looking for the answer i re-check from post # 19 changes no luck please help

  25. #25
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    ProntonLeah
    I did a lot of testing after repeatedly re-entering stats to run the code. The VBA code seems to be working; it only needs a few adjustments, I notice.
    My pro bets sheet.
    if the code can produce row 12 as row 13 Leaving only Time in cell F13 and Tournament Name to "Speed Racer Bounty $2.16 [10 BB]"
    For Tournaments sheet.
    1. Time seems to remain double shows like this Oct 26, 01:45Oct 2601:45
    2. if the code can produce to leave only 1 game as per # of entries in rows 14:15 I highlighted in green, which in this case I didn't get a prize for any re-entry.
    In rows 32:34 I highlighted in green (3) entries in #3 I got the prize of $15.12 which is the one I would like and for any that there is no prize to be deleted.
    In rows, 47:52 is a bit more complicated (6) number of entries, where my prize is $1.24 adding the amt. of 0.37, 0.25, and 0.62
    could it be added to the least number in rank which would be #6 row 48 to be a total of $1.24? not sure is possible.
    is there a way to refresh entire workbook to re-enter new entries? as it will stop running code after 1st set of entries.
    Please feel free to ask any questions.
    Attached Files Attached Files
    Last edited by west123; 11-23-2024 at 11:35 PM.

  26. #26
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    .................
    Last edited by west123; 07-04-2025 at 06:13 PM.

  27. #27
    Forum Contributor
    Join Date
    11-13-2022
    Location
    usa
    MS-Off Ver
    plus 2021
    Posts
    2,514

    Re: vba macro to Remove Specific Text From Cell | to produce formated text.

    In this file, I cut the games played to 3 days in all sheets

    Can someone help on why I can't run the VBA Code more than once,
    after entering new games into the sheets? It seems it only lets me run code 1 time, then after entering any new game, the code stops running.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] vba code to Remove Specific Text From Cell | specific string | Specific Characters
    By west123 in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 07-31-2024, 02:56 PM
  2. [SOLVED] Remove all from right of specific text in cell
    By king10001 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-22-2016, 08:13 AM
  3. Remove row if the cell below contains specific text.
    By Teblol in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-05-2015, 04:55 PM
  4. [SOLVED] Macro to remove text in specific columns
    By matthew1404 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 08-28-2012, 02:15 PM
  5. Macro to Remove text based on specific parameters
    By jhc8255 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-05-2010, 10:39 PM
  6. How do I remove all text in a cell after a specific character?
    By moi in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 07:05 AM
  7. [SOLVED] How do I remove all text in a cell after a specific character?
    By Erik Millerd in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1