例如A1内容:0.75*1.219*2.438 我想提取此单元格中的前四位字符"0.75"到另一单元格C1?
C1中输入 =left(A1,4) 这是以4个为标准。
例如A1内容: 中山市东凤镇,我想提取此单元格中的前四位字符"中山市"到另一单元格C1?
C1中输入 =left(A1,3) 这是以4个为标准。
="要显示的字符" & a2
a2为其它单元格
A2 是身份证号 B2 输入:=mid(A2,7,8)
在A1的单元格中输入“101”,在A2中则显示“壹佰零壹元整(¥101.00)”
A2输入
=IF(A1=0,"",IF(INT(A1),TEXT(TRUNC(A1),"[dbnum2]")&"元","")&IF(MOD(A1,1)=0,"整",IF(TRUNC(A1,1),IF(A1=TRUNC(A1,1),TEXT(LEFT(RIGHT(A1*100,2)),"[dbnum2]0角整"),TEXT(RIGHT(A1*100,2),"[dbnum2]0"&IF(LEFT(RIGHT(A1*100,2))="0","","角")&"0分")),TEXT(A1*100,"[dbnum2]0分"))))&"("&TEXT(a1,"¥#,##0.00;¥-#,##0.00")&")"
=VLOOKUP(A1,SHEET1!A:B,2,),下拉。
B1=INDEX({输出1,输出2,输出3},MATCH(A1,{条件1,条件2,条件3},0)) 如 A1=1,B1=a; A1=2,B1=b; A1=3,B1=c: B1=INDEX({"a","b","c"},MATCH(A1,{1,2,3},0)) 增加一个条件: B1=INDEX({"a","b","c","d"},MATCH(A1,{1,2,3,4},0))
在工作表右键代码中输入(只限B列 )
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row >= 1 And Target.Row <= 1000 And Target.Column = 2 Then
If Target.Cells = "cd" Then
Application.EnableEvents = False
Target.Cells = "迟到**"
Application.EnableEvents = True
End If
If Target.Cells = "kk" Then
Application.EnableEvents = False
Target.Cells = "旷课**"
Application.EnableEvents = True
End If
End If
End Sub
例如:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row >= 1 And Target.Row <= 100 And Target.Column = 2 Then
If Target.Cells = "cd" Then
Application.EnableEvents = False
Target.Cells = "迟到**"
Application.EnableEvents = True
End If
If Target.Cells = "kk" Then
Application.EnableEvents = False
Target.Cells = "旷课**"
Application.EnableEvents = True
End If
If Target.Cells = "xk" Then
Application.EnableEvents = False
Target.Cells = "校卡*"
Application.EnableEvents = True
End If
If Target.Cells = "yb" Then
Application.EnableEvents = False
Target.Cells = "仪表**"
Application.EnableEvents = True
End If
If Target.Cells = "bj" Then
Application.EnableEvents = False
Target.Cells = "病假"
Application.EnableEvents = True
End If
If Target.Cells = "sj" Then
Application.EnableEvents = False
Target.Cells = "事假**"
Application.EnableEvents = True
End If
If Target.Cells = "cc" Then
Application.EnableEvents = False
Target.Cells = "出操**"
Application.EnableEvents = True
End If
If Target.Cells = "sw" Then
Application.EnableEvents = False
Target.Cells = "食物**"
Application.EnableEvents = True
End If
If Target.Cells = "zr" Then
Application.EnableEvents = False
Target.Cells = "值日**"
Application.EnableEvents = True
End If
If Target.Cells = "kt" Then
Application.EnableEvents = False
Target.Cells = "课堂**"
Application.EnableEvents = True
End If
If Target.Cells = "zt" Then
Application.EnableEvents = False
Target.Cells = "早退**"
Application.EnableEvents = True
End If
End If
End Sub
小学语文
公
众
号
联系电话:13923313362(微信)
QQ:546230019
公众号:中职实用语文/小学语文精讲精练
刘志刚老师工作室 www.lzgang.com
粤ICP备13056388号-1 名称:我的天地
中职语文
公
众
号