Created
May 14, 2018 03:28
-
-
Save TGDUY/adf7d373f07ad132dfd2dd60cd9261fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub Loc() | |
| Dim DATA As Variant, I As Long, J As Long, TMP As Variant, MA As String, T As Double | |
| DATA = Sheet1.Range("A2:C" & Sheet1.Cells(Sheet1.Rows.Count, "C").End(xlUp).Row).Value2 | |
| T = Timer | |
| ReDim TMP(0) | |
| J = -1 | |
| For I = 1 To UBound(DATA, 1) | |
| MA = CStr(DATA(I, 1) & DATA(I, 2)) | |
| If MA <> vbNullString Then | |
| J = J + 1 | |
| ReDim Preserve TMP(J) | |
| TMP(J) = DATA(I, 3) | |
| Else | |
| TMP(J) = TMP(J) & " ; " & DATA(I, 3) | |
| End If | |
| Next | |
| Sheet1.Range("J2:J1048576").ClearContents | |
| Sheet1.Range("J2").Resize(UBound(TMP, 1) + 1) = Application.Transpose(TMP) | |
| MsgBox Round(Timer - T, 3) | |
| End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment