• VBA and Right( ) functino (Excel 2000 and 2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » VBA and Right( ) functino (Excel 2000 and 2003)

    Author
    Topic
    #430745

    Hi , I’m stuck …

    Say, I have text in Cell B1. And, I need to check if the last character is an “F”.
    I can do this easily in a cell on a sheet/tab by using:
    =IF(RIGHT(B1,1)=”F”,”Do True Stuff”,”Do False Stuff”)

    However, I need to do this in VBA code …and I don’t know how.

    So, any help would be really appreciated.

    Nite,
    –cat

    Viewing 0 reply threads
    Author
    Replies
    • #1006681

      It’s pretty much the same:

      Sub TestForF()
          
          If Right(Range("B1"), 1) = "F" Then
              MsgBox "true"
              Else
              MsgBox "False"
          End If
      End Sub
    Viewing 0 reply threads
    Reply To: VBA and Right( ) functino (Excel 2000 and 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: