This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub UnMergeFill() | |
'from http://stackoverflow.com/questions/9215022/unmerging-excel-rows-and-duplicate-data | |
Dim cell As Range, joinedCells As Range | |
on error resume next | |
For Each cell In ThisWorkbook.ActiveSheet.UsedRange | |
If cell.MergeCells Then | |
Set joinedCells = cell.MergeArea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) | |
Dim msg As Outlook.MailItem | |
Dim favAcctName As String | |
On Error Resume Next | |
If TypeOf Item Is Outlook.MailItem Then | |
favAcctName = Application.Session.Accounts(1).DisplayName '定义不检查的邮箱地址 | |
Set msg = Item | |
If msg.SendUsingAccount <> favAcctName Then | |
res = MsgBox(msg.SendUsingAccount & "不是默认邮箱地址,确定使用它发送么?", _ | |
vbYesNoCancel + vbQuestion, _ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub createPageBreak() | |
'创建分页 | |
'在小计后面添加手动分页 | |
For i = 1 To 10000 '只到10000行 | |
If Cells(i, 1) = "小计" Then '设置分行内容 | |
Cells(i, 1).Select | |
ActiveCell.Offset(1, 1).Rows("1:1").EntireRow.Select | |
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell | |
End If |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub createhyperlink() | |
' | |
' 将选中的表格,链接到标题为表格内容中的表。 | |
' 举个列子,如果单元格的内容是foo,就会把这个表格链接到foo表。 | |
' | |
' | |
On Error Resume Next | |
For Each celln In Selection | |
celln.Select |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Declare Function OpenClipboard Lib "user32" (ByVal Hwnd As Long) As Long | |
Private Declare Function CloseClipboard Lib "user32" () As Long | |
Private Declare Function EmptyClipboard Lib "user32" () As Long | |
'''''''''''''' | |
'这个宏的功能是清空剪贴板,当复制东西的时候,然后要插入什么,不能单纯的插入,只能插入复制的内容 | |
'这个宏就是清空剪贴板,让你可以插入空白 | |
'清空剪贴板,需要上面的声明。 | |
'参考http://club.excelhome.net/forum.php?mod=redirect&goto=findpost&ptid=767916&pid=5233159 | |
'''''''''''''' | |
Sub clearClipboard() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function tax(salary As Double) As Double | |
Application.Volatile '让Excel频繁计算,避免更改工资还不更新个税 | |
'''个人所得税计算函数 | |
If salary < 3500 Then | |
tax = 0 | |
Else | |
g = salary - 3500 | |
Select Case g | |
Case Is <= 1500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.markdown-body { | |
font-size: 14px; | |
line-height: 1.6; | |
} | |
.markdown-body > *:first-child { | |
margin-top: 0 !important; | |
} | |
.markdown-body > *:last-child { | |
margin-bottom: 0 !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
NewerOlder