You start off talking about using a macro to "format" something, but don't tell us what. Are you putting the data somewhere else? Another sheet? Another cell?
The format issue aside, if what you're asking is how to use VBA to set the value of one cell to either 6YB or 6YA based on the value of cell AA21, then that code would be:
Code:
If Range("AA21").Value = "USD" Then
Range("AB21").Value = "6YB"
Else
Range("AB21").Value = "6YA"
End If
Just change the "AB21" to the cell you actually want to adjust and insert that code into your macro.