Calculate Percentile Rank and Highlight Highest Percentile Group in Excel

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ธ.ค. 2024

ความคิดเห็น • 3

  • @mostainbillah
    @mostainbillah 3 หลายเดือนก่อน

    Dear Sir ,I have Need a code for Extract string In specific Cell .
    Please See My Apply.
    Range("C5") = W5606 ENG 04 03 11 -BANGLADESH-DHAKA.ord
    1. Need first Word of Line “ W5606 “
    2. Remove Frist word & Before First Dash part -“ENG 04 03 11”
    3. After Dash “ BANGLADESH”
    4. Last Word After second Dash “ DHAKA “
    Extract Range:
    Range("A29") = W5606
    Range("B29") = ENG 04 03 11
    Range("C29") = BANGLADESH
    Range("D29") = DHAKA
    Delete = .ord From C5 cell

    • @ExcelWithBrainBell
      @ExcelWithBrainBell  3 หลายเดือนก่อน +1

      Thank you for your question! You can achieve this by using VBA:
      Sub ExtractString()
      Dim fullString As String
      Dim firstWord As String
      Dim secondPart As String
      Dim thirdPart As String
      Dim fourthPart As String
      Dim dashPos1 As Integer
      Dim dashPos2 As Integer
      ' Get the string from C5 and remove the ".ord" part
      fullString = Replace(Range("C5").Value, ".ord", "")
      ' Extract the first word (W5606)
      firstWord = Split(fullString, " ")(0)
      ' Find the position of the first dash
      dashPos1 = InStr(fullString, "-")
      ' Extract the second part (ENG 04 03 11)
      secondPart = Mid(fullString, Len(firstWord) + 2, dashPos1 - Len(firstWord) - 2)
      ' Extract the third part (BANGLADESH)
      dashPos2 = InStr(dashPos1 + 1, fullString, "-")
      thirdPart = Trim(Mid(fullString, dashPos1 + 1, dashPos2 - dashPos1 - 1))
      ' Extract the fourth part (DHAKA)
      fourthPart = Trim(Mid(fullString, dashPos2 + 1))
      ' Place the extracted parts into the specified ranges
      Range("A29").Value = firstWord
      Range("B29").Value = secondPart
      Range("C29").Value = thirdPart
      Range("D29").Value = fourthPart
      Range("C5").Value = fullString
      End Sub
      To use this code, follow these steps:
      1. Press ALT + F11 to open the VBA editor.
      2. Go to Insert > Module to insert a new module.
      3. Copy and paste the code above into the module.
      4. Close the VBA editor.
      5. Run the macro ExtractString from the Excel workbook.
      This will extract the string as you described and place them in the specified cells (A29, B29, C29, and D29).
      I hope this helps!

    • @mostainbillah
      @mostainbillah 3 หลายเดือนก่อน +1

      Thank you very much, I am grateful to you, may Allah bless you ❤️