在AJ列中,有一个行情清单:
02382 HK
00700 HK
0WI GR
如果最后两个字母是HK,我想删除前面的零。所以上面应该是:
2382 HK
700 HK
0WI GR
感谢您的帮助
答案 0 :(得分:1)
可以在没有VBA的情况下实现:
=IF(RIGHT(AJ2,2)="HK",1*LEFT(AJ2,FIND(" ",AJ2))&" HK",AJ2)
答案 1 :(得分:0)
我建议使用此功能
// @material-ui/icons
import Dashboard from "@material-ui/icons/Dashboard";
import Logs from "@material-ui/icons/Assignment";
import Index from "./views/Index";
import LoggingPage from "./views/Logging";
const dashboardRoutes = [
{
path: "/",
sidebarName: "Home",
navbarName: "Index",
icon: Dashboard,
component: Index
},
{
path: "/logging",
sidebarName: "Logs",
navbarName: "Logs",
icon: Logs,
component: LoggingPage
},
{ redirect: true, path: "/", to: "/dashboard" }
];
export default dashboardRoutes;
这也适用于Function RemoveIt(s As String) As String
If Right(s, 2) = "HK" Then
Dim i As Long
Dim l As Long
l = Len(s)
For i = 1 To l
If Left(s, 1) = "0" Then
s = Right(s, Len(s) - 1)
Else
Exit For
End If
Next i
End If
RemoveIt = s
End Function
或002382HK
之类的字符串