下面图老师小编跟大家分享Excel快速批量算出工龄工资且不超年数上限,一起来学习下过程究竟如何进行吧!喜欢就赶紧收藏起来哦~
【 tulaoshi.com - excel 】
今天教大家如何用Excel快速批量算出工龄工资且不超年数上线。元旦来了,大多公司的员工的工龄工资又该上涨了。在这里为大家谋福利了,可以让我们会记省力些。例如我们假设工龄工资每年为50元,20年为上限,超过20年的按照20计算,然后我们设置批量算出各个不同时间入职的员工的工龄工资。
公式:MIN(20,DATEDIF(B2,TODAY(),"y"))*50
datedif(开始日期,结束日期,Y/M/D):计算开始日期和结束日期之间相距的年数或者月数天数。
先用datedif函数计算出工龄,如果工龄小于20,那么会返回这个小于20的值,如果大于20,min函数会返回20,最后再乘以50.
案例演示
①下表所示,销售人员名字以及入职日期,规定是工龄工资每年50元,20年封顶,首先,我们在C2单元格输入: =MIN(20,DATEDIF(B2,TODAY(),"y"))*50 。
②回车,得到结果650,因为孙宁是2000年入职的,现在2013年,13年了,13*50=650,答案正确。
③双击单元格填充柄,完成下面单元格的计算。
在表格中一般都有日期的标明但是很少标出是周几的,但有时候工作需要我们是需要知道周几,比如我们想知道周六周日是哪天,那么我们的表格中如何能够自动显示出来呢?今天跟大家分享的教程就是在Excel2013表格中的日期如何自动显示是周日
案例演示
①启动Excel2013,打开表格数据,选中D列,右击,设置单元格格式,或者按下Ctrl+1键,也可以打开设置单元格格式对话框。
②在对话框中,单击最下面的自定义,类型输入aaaa,确定。
③这样,以年月日形式的日期转变为了星期几的形式,继续单击菜单栏--数据--筛选。
④D列出现三角箭头,单击它,依次点击日期筛选--自定义筛选。
⑤设置筛选条件,等于周六或等于周日,这在数学上的逻辑关系应该是或,即满足其中一个条件即可。与的话就是要全部满足。
⑥条件设置完毕,确定,最后就选出了周六和周日的数据。
我们都知道制作条码需要用领跑标签条码打印软件才能完成的,而且专业的印刷厂或者是关于防伪设计之类的公司都是要依靠领跑标签条码打印软件去工作的,可是像我们这些非专业的,偶尔用一下的人该怎么办呢?虽然说领跑标签条码打印软件是免费的,但不还是要下载的嘛,今天就是专门给懒人准备的哦,叫你如何用Excel2007表格生成条形码,快来学习吧。
①首先建立俩个单元格,一个输入文字:请输入条形码数字,下方输入13位数字。然后单击菜单栏--开发工具--插入--其他控件。
②弹出控件选择对话框,我们下拉滚动条,选择Microsoft Barcode Control 9.0这个,如果大家看不到,那就需要另外安装了,单击这个链接即可下载安装:http://www.microsoft.com/zh-cn/download/confirmation.ASPx?id=8913
③控件插入完成,我们通过鼠标画出这个条形码,然后点击属性按钮。
④将LinkedCell设置为第一步填入数字的单元格,即A2,这样条形码生成的数字就与之相同。
⑤如果大家想改变条形码上的数字,直接在A2单元格输入即可,大家要注意,我们输入数字之前,先要输入一个英文半角状tulaoshi.com态下的单引号,然后再输入一个13位的数字,因为,条形码都是13位的,这样符合逻辑。
有时候我们需要根据一堆人名或者身份证号批量新建文件夹或者文件,本节教程均适用。原理,利用Excel的基本功能批量生成CMD命令,然后粘贴保存到bat文件中,双击执行即可。
1、打开excel表格:
2、在2B单元格输入:="MD "&A2
熟悉MD命令的都知道这个命令是新建文件夹的命令。
3、选中2B单元格,向下拖拉复制至最后一行:
这样就得到了很多个MD命令。
4、将上图中B列中的内容全部复制到记事本中:
5、将记事本保存后,改扩展名为bat:
6、改完后双击执行即可。试试看,效果不错吧?
网上下载了工作簿,发现居然有密码!xxoo,既然放网上干嘛要加密码啊?!后来网上找到使用VBA破解工作表密码的方法,拿来分享。
首先,尝试打开工作簿时,提示有密码:
使用快捷键Ctrl+F11键,打开VBA编辑界面,点击插入菜单下的子菜单模块:
在模块编辑器中输入以下代码:
Option Explicit
Public Sub AllInternalPasswords()
Const DBLSPACE As String = vbNewLine & vbNewLine
Const AUTHORS As String = DBLSPACE & vbNewLine & _
"Adapted from Bob McCormick base code by" & _
"Norman Harker and JE MCGImpsey"
Const HEADER As String = "AllInternalPasswords User Message"
Const VERSION As String = DBLSPACE
Const REPBACK As String = DBLSPACE & "Please report failure " & _
"to the microsoft.public.Excel.programming newsgroup."
Const ALLCLEAR As String = DBLSPACE & "The workbook should " & _
"now be free of all password protection, so make sure you:" & _
DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _
DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _
DBLSPACE & "Also, remember that the password was " & _
"put there for a reason. Don't stuff up crucial formulas " & _
"or data." & DBLSPACE & "Access and use of some data " & _
"may be an offense. If in doubt, don't."
Const MSGNOPWORDS1 As String = "There were no passwords on " & _
"sheets, or workbook structure or windows." & AUTHORS & VERSION
Const MSGNOPWORDS2 As String = "There was no protection to " & _
"workbook structure or windows." & DBLSPACE & _
"Proceeding to unprotect sheets." & AUTHORS & VERSION
Const MSGTAKETIME As String = "After pressing OK button this " & _
"will take some time." & DBLSPACE & "Amount of time " & _
"depends on how many different passwords, the " & _
"passwords, and your computer's specification." & DBLSPACE & _
"Just be patient! Make me a coffee!" & AUTHORS & VERSION
Const MSGPWORDFOUND1 As String = "You had a Worksheet " & _
"Structure or Windows Password set." & DBLSPACE & _
"The password found was: " & DBLSPACE & "$$" & DBLSPACE & _
"Note it down for potential future use in other workbooks by " & _
"the same person who set this password." & DBLSPACE & _
"Now to check and clear other passwords." & AUTHORS & VERSION
Const MSGPWORDFOUND2 As String = "You had a Worksheet " & _
"password set." & DBLSPACE & "The password found was: " & _
DBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & _
"future use in other workbooks by same person who " & _
"set this password." & DBLSPACE & "Now to check and clear " & _
"other passwords." & AUTHORS & VERSION
Const MSGONLYONE As String = "Only structure / windows " & _
"protected with the password that was just found." & _
ALLCLEAR & AUTHORS & VERSION & REPBACK
Dim w1 As Worksheet, w2 As Worksheet
Dim i As Integer, j As Integer, k As Integer, l As Integer
Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer
Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer
Dim PWord1 As String
Dim ShTag As Boolean, WinTag As Boolean
Application.ScreenUpdating = False
With ActiveWorkbook
WinTag = .ProtectStructure Or .ProtectWindows
End With
ShTag = False
For Each w1 In Worksheets
ShTag = ShTag Or w1.ProtectContents
Next w1
If Not ShTag And Not WinTag Then
MsgBox MSGNOPWORDS1, vbInformation, HEADER
Exit Sub
End If
MsgBox MSGTAKETIME, vbInformation, HEADER
If Not WinTag Then
MsgBox MSGNOPWORDS2, vbInformation, HEADER
Else
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/ejc/)On Error Resume Next
Do 'dummy do loop
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/ejc/)For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
With ActiveWorkbook
.Unprotect Chr(i) & Chr(j) & Chr(k) & _
Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
If .ProtectStructure = False And _
.ProtectWindows = False Then
PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
MsgBox Application.Substitute(MSGPWORDFOUND1, _
"$$", PWord1), vbInformation, HEADER
Exit Do 'Bypass all for...nexts
End If
End With
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
End If
If WinTag And Not ShTag Then
MsgBox MSGONLYONE, vbInformation, HEADER
Exit Sub
End If
On Error Resume Next
For Each w1 In Worksheets
'Attempt clearance with PWord1
w1.Unprotect PWord1
Next w1
On Error GoTo 0
ShTag = False
For Each w1 In Worksheets
'Checks for all clear ShTag triggered to 1 if not.
ShTag = ShTag Or w1.ProtectContents
Next w1
If ShTag Then
For Each w1 In Worksheets
With w1
If .ProtectContents Then
On Error Resume Next
Do 'Dummy do loop
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/ejc/)For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
.Unprotect Chr(i) & Chr(j) & Chr(k) & _
Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
If Not .ProtectContents Then
PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
MsgBox Application.Substitute(MSGPWORDFOUND2, _
"$$", PWord1), vbInformation, HEADER
'leverage finding Pword by trying on other sheets
For Each w2 In Worksheets
w2.Unprotect PWord1
Next w2
Exit Do 'Bypass all for...nexts
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
End If
End With
Next w1
End If
MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER
End Sub
点击运行:
破解过程需要几分钟,有几次对话框弹出,都是英文的,留意对话框中如下内容:
标注部分即为密码。虽然不是原始密码,但是用这个密码照样可以打开工作簿的。
最近整理一个Excel文档,里面有很多超级链接需要取消删除,一个一个取消实在是太费时费力了,于是找到一个使用宏功能批量取消删除超级链接的方法。
①使用Excel快捷键 Ctrl + F8 ,在弹出的宏窗口的宏名中输入一个名称,然后单击创建按钮;
此时,会弹出一个 Microsoft Visual Basic 窗口;
②在 Sub 和 End Sub 之间输入 Cells.Hyperlinks.Delete ,然后单击保存按钮,将其保存起来(保存到任意地方都可以);
③回到刚才的表格中,单击菜单栏的工具,在下来列表中选择宏里面的宏;
④在弹出的宏窗口中点击执行按钮即可批量去掉Excel表格中所有的超级链接。
看看是不是所有的超级链接都已经删除干净了呢?
大家都知道Excel中列的拆分,但有时候我们却不只需要这个,我们还需要将列中的数据进行拆分。比如,将123456,拆成两列,一列是123,另一列是456。我们来看看excel是如何将列中数据进行拆分的。
①首先,我们在Excel表格中选中需要拆分的列;
②然后,单击菜单栏的数据,在下拉列表中选择分列命令;
③此时,需要3个步骤来完成数据在表格中的拆分,文本分列向导 - 3 步骤之 1,我们只需选择默认的分割符号再单击下面的下一步按钮;
④然后,继续在文本分列向导 - 3 步骤之 2下面的分隔符号中勾选Tab 键、空格和连续分隔符号视为单个处理。(现在我们可以在数据预览中看到拆分的效果)最后单击下一步;
⑤最后一个步骤,我们单击完成就可以了。
拆分好的表格效果如下图所示:
来源:http://www.tulaoshi.com/n/20160401/2074561.html
看过《Excel快速批量算出工龄工资且不超年数上限》的人还看了以下文章 更多>>