2016-06-21 3 views
0

Wenn ich die PercentRank-Funktion verwende, spuckt das Meldungsfeld die Zahl in einem "0.00" -Nummernformat aus. Gibt es eine Möglichkeit, das zu ändern? Vorzugsweise haben sie kommen als "00%"Ändern Sie das Zahlenformat der PercentRank-Funktionsausgabe

x = WorksheetFunction.PercentRank(relevant_Array, answer, 2) 
      If x > 0.7 Then MsgBox "WARNING: Price is more than 20% above the average price: " & x 
      If x < 0.3 Then MsgBox "WARNING: Price is more than 20% below the average price: " & x 
      If x > 0.3 And x < 0.7 Then MsgBox "Carry on: your price seems to be accurate: " & x 

Antwort

1

Haben Sie versucht, VBA Format function?

If x > 0.7 Then MsgBox "WARNING: Price is more than 20% above the average price: " & Format(x, "00%") 
0

Sie können auch versuchen, diese ...

If x > 0.7 Then MsgBox "WARNING: Price is more than 20% above the average price: " & Round(x*100,0) & ''%''