Consulting

Results 1 to 6 of 6

Thread: VBA to Extract digit and text from two different columns of excel

  1. #1
    VBAX Regular
    Joined
    Aug 2021
    Posts
    8
    Location

    VBA to Extract digit and text from two different columns of excel

    Hello Sir,


    I developed a VBA that will extract all Outlook email based on the subject line as 'Submitted' and store it in Col A and B of 'Out'sheet. My req is
    1)To retrieve the digit available between square bracket from col A . E.g. '10234563' from R1

    2)To extract text present between "Headline" and "Description" from COl B. E.g. '121 - Person has complained about the product' from R1


    3)To pull digit from text beginning with 'TID' in first encounter. E.g. '21345' from R6




    Once extraction is done, the value from req-1, req-2, req-2 need to be added into Col A, col B, Col H of Sheet "Datas" (before that clear content of sheet 'Datas' as old records might exist for earlier operation)


    4)Delete entire record from Sheet "Datas" for duplicate only when [value in Col A is not null and for col B is null]

    E.g.The value '11111' from R7 & R8 are duplicate. Row number 7 (R7) should be removed as it contain null value for col B
    Attached Files Attached Files

  2. #2
    VBAX Regular
    Joined
    Aug 2021
    Posts
    8
    Location
    Can anyone help me for the solution of my query

  3. #3
    i made some function in module1.
    see Out sheet.

    sorry, my browser won't allow me to attached (it says unsecured).

    https://www.dropbox.com/scl/fi/qahbm...dn73cz4neyxdrq

  4. #4
    VBAX Regular
    Joined
    Aug 2021
    Posts
    8
    Location
    Thank you so much arnelgp for your great help. As I don't have much knowledge on macro, can all this macro can be called with a single master macro without mentioning formula. The program should auto populate the activities. Thanks once again

  5. #5
    it is meant to be run as Function (just as ordinary excel function).

  6. #6

    FORMULA SOLUTION

    Hi
    Simple Excel formula should do the trick
    Formula 1 (J2) =COUNTIFS(A:A,A2)
    Formula 2 (K2) =IF(AND(J2>1,B2=""),"DUPLICATE","")

    Filter "DUPLICATES" and delete the ROWS

    Sample file attached

    If you need a automated process - kindly contact
    Attached Files Attached Files

Posting Permissions

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