none
What the line is achieving RRS feed

  • Question

  • Hi,

    What is it achieving, by the last line below?

                    Set C2 = .Find(Str0, LookIn:=xlValues, LookAt:=xlPart, MatchCase:=xlfalse)

                   

                    If Not C2 Is Nothing Then

                        'Str1 = Right(UCase(Trim(C2)), 1)

                        Str1 = Right(Trim(C2), 1)

                        Debug.Print CStr(i) & Str1

                            Select Case Str1

                                'IF M, O, R IN c2 THEN TRANSCRIBE

                                Case "M", "0", "C"

                                    Worksheets("Columns Map2").Cells(i, 3).Value = Trim(Str1)

                                Case Else

                                'OTHERWISE LOOK IN CELLS TO RIGHT

                                    Set c3 = C2.Offset(0, 1)



    Many Thanks & Best Regards, Hua Min



    Tuesday, May 23, 2017 3:14 AM

Answers

  • The last line of code is setting C3 to one cell to the right of where C2 was found. I have no idea what it achieves but the comment seems to suggest to look in the value of the cell one to the right to see if it contains required data but without all of the code and an example of the data, it is impossible to guess what it really achieves.

    Regards, OssieMac

    • Marked as answer by Jackson_1990 Tuesday, May 23, 2017 8:01 AM
    Tuesday, May 23, 2017 4:51 AM

All replies

  • The last line of code is setting C3 to one cell to the right of where C2 was found. I have no idea what it achieves but the comment seems to suggest to look in the value of the cell one to the right to see if it contains required data but without all of the code and an example of the data, it is impossible to guess what it really achieves.

    Regards, OssieMac

    • Marked as answer by Jackson_1990 Tuesday, May 23, 2017 8:01 AM
    Tuesday, May 23, 2017 4:51 AM
  • Does the line mean, to check next right cell of C2, for another exact match?



    Many Thanks & Best Regards, Hua Min


    Tuesday, May 23, 2017 5:18 AM
  • Does the line mean, to check next right cell of C2, for another exact match?

    I am now assuming that you got the code from elsewhere and you are trying to decipher what it does. I really need to see all of the code after the line to determine the author's intention.


    Regards, OssieMac

    Tuesday, May 23, 2017 8:34 AM