按键盘上方向键 ← 或 → 可快速上下翻页,按键盘上的 Enter 键可回到本书目录页,按键盘上方向键 ↑ 可回到本页顶部!
————未阅读完?加入书签已便下次继续阅读!
…………………………………………………………Page 127……………………………………………………………
Excel_word_ppt_使用技巧大全(完全版)
Dim codedPW As String
Dim i As Integer
Dim ch As String * 1
If Len(pw) = 0 Then
EncodePassword = 〃〃
Exit Function
End If
codedPW = 〃〃
pw = Trim(pw)
For i = 1 To Len(pw)
ch = Mid(pw; i; 1)
'codedPW = codedPW & Chr(Asc(ch) + (Cos(i) * i + Sin(200 * i) * i + Log(100 + i * i)))
& Chr(Asc(ch) + (Cos(i) * i + Sin(100 * i) * i + Log (50 + i * i)))
'codedPW = codedPW & Chr(Asc(ch) + (Cos(i) + Sin(200 * i))) & Chr(Asc(ch) + (Cos(i)
+ Sin(100 * i)))
codedPW = codedPW & Chr(Asc(ch) + (Cos(i) * i + Sin(200 * i) * i + Log(100 + i * i)
1。5 * i)) & Chr(Asc(ch) + (Cos(i) * i + Sin(100 * i) * i + Log(50 + i * i) 1。5
* i))
Next i
EncodePassword = codedPW
End Function
Public Function DecodePassword(codedPW As String) As String
' 传递编码后的pw,并返回解码的 pw。
Dim decodedPW As String
Dim i As Integer
Dim ch As String * 1
If Len(codedPW) = 0 Then
DecodePassword = 〃〃
Exit Function
End If
decodedPW = 〃〃
codedPW = Trim(codedPW)
For i = 1 To Len(codedPW)
CXXVII
…………………………………………………………Page 128……………………………………………………………
Excel_word_ppt_使用技巧大全(完全版)
ch = Mid(codedPW; i; 1)
If i Mod 2 = 1 Then
'decodedPW = decodedPW & Chr(Asc(ch) (Cos((i + 1) / 2) * (i + 1) / 2 + Sin(200 *
(i + 1) / 2) * (i + 1) / 2 + Log(100 + (i + 1) / 2 * (i + 1) / 2)))
'decodedPW = decodedPW & Chr(Asc(ch) (Cos((i + 1) / 2) + Sin(200 * (i + 1) / 2)))
decodedPW = decodedPW & Chr(Asc(ch) (Cos((i + 1) / 2) * (i + 1) / 2 + Sin(200 * (i
+ 1) / 2) * (i + 1) / 2 + Log (100 + (i + 1) / 2 * (i + 1) / 2) (i + 1) / 2 * 1。5))
Else
decodedPW = decodedPW
End If
Next
DecodePassword = decodedPW
End Function
Sub Macro1()
'
' Macro1 Macro
' Wang Jinbo 记录的宏 2004…12…28
'
' 快捷键: Ctrl+z
'
'
' ActiveWorkbook。RefreshAll
' Userform1。Hide
Dim WP19 As Worksheet
Set WP19 = Sheets(〃WP1019〃)
Dim Summary As Worksheet
Set Summary = Sheets(〃Summary〃)
'Sheets(〃Summary〃)。Select
'Cells。Select
'Summary。Range(A2; P9999)。Select
'Selection。ClearContents
'Selection。Clear
CXXVIII
…………………………………………………………Page 129……………………………………………………………
Excel_word_ppt_使用技巧大全(完全版)
Dim SourceRow As Integer
SourceRow = 2
Dim TargetRow As Integer
TargetRow = 2
Dim OPRow As Integer
OPRow = 2
Dim RevaluationRow As Integer
RevaluationRow = 2
Dim OP As Double
Dim Revaluation As Double
WP19。Activate
While Not IsEmpty(WP19。Cells(SourceRow; 1))
If WP19。Cells(SourceRow; 2) = 2 And WP19。Cells(SourceRow; 3) WP19。Cells(SourceRow
1; 3) Then
Summary。Activate
Summary。Range(Cells(TargetRow; 1); Cells(TargetRow; 1))。Select
Summary。Cells(TargetRow; 1) = WP19。Cells(SourceRow; 3)
Summary。Range(Cells(TargetRow; 2); Cells(TargetRow; 2))。Select
ActiveCell。FormulaR1C1 = 〃=VLOOKUP(RC'…1';WP1002!C'…1':C'1';3;FALSE)〃
Summary。Range(Cells(TargetRow; 3); Cells(TargetRow; 3))。Select
ActiveCell。FormulaR1C1 = 〃=VLOOKUP(RC'…2';WP1002!C'…2':C;2;FALSE)〃
Summary。Range(Cells(TargetRow; 4); Cells(TargetRow; 4))。Select
ActiveCell。FormulaR1C1 = 〃=VLOOKUP(RC'…1';RS1002!C'…3':C'…1';3;FALSE)〃
Summary。Range(Cells(TargetRow; 5); Cells(TargetRow; 5))。Select
ActiveCell。FormulaR1C1 = 〃=VLOOKUP(RC'…4';WP1002!C'…4':C;5;FALSE)〃
Summary。Range(Cells(TargetRow; 6); Cells(TargetRow; 6))。Select
ActiveCell。FormulaR1C1 = _
〃=IF(ISNA(VLOOKUP(RC'…5';OB!C'…5':C;6;FALSE))=TRUE;0;VLOOKUP(RC'…5';OB!C'…5':C;6;
FALSE))〃
Summary。Range(Cells(TargetRow; 7); Cells(TargetRow; 7))。Select
ActiveCell。FormulaR1C1 = _
〃=SUMIF('IN1012'!C'4':C'5';Period!R2C2&〃〃05〃〃&RC'…6';'IN1012'!C'5')〃
Summary。Range(Cells(TargetRow; 8); Cells(TargetRow; 8))。Select
ActiveCell。FormulaR1C1 = _
CXXIX
…………………………………………………………Page 130……………………………………………………………
Excel_word_ppt_使用技巧大全(完全版)
〃=IF(ISNA(VLOOKUP(Period!R6C2&RC'…7'&〃〃031〃〃;WP1019!C'…2':C'…1';2;FALSE))=TRUE;0;
VLOOKUP(Period!R6C2&RC'…7'&〃〃031〃〃;WP1019!C'…2':C'…1';2;FALSE)+ISNA(VLOOKUP(Perio
d!R6C2&RC'…7'&〃〃032〃〃;WP1019!C'…2':C'…1';2;FALSE))=TRUE;0;VLOOKUP(Period!R6C2&RC'
…7'&〃〃032〃〃;WP1019!C'…2':C'…1';2;FALSE)+ISNA(VLOOKUP(Period!R6C2&RC'…7'&〃〃033〃〃;W
P1019!C'…2':C'…1';2;FALSE))=TRUE;0;VLOOKUP(Period!R6C2&RC'…7'&〃〃033〃〃;WP1019!C'…2
':C'…1';2;FALSE)+ISNA(VLOOKUP(Period!R6C2&RC'…7'&〃〃034〃〃;WP1019!C'…2':C'…1';2;FAL
SE))=TRUE;0;VLOOKUP(Period!R6C2&RC'…7'&〃〃034〃〃;WP1019!C'…2':C'…1';2;FALSE)+ISNA(V
LOOKUP (Period!R6C2&RC'…7'&〃〃040〃〃;WP1019!C'…2':C'…1';2;FALSE))=TRUE;0;VLOOKUP(Per
iod!R6C2&RC'…7'&〃〃040〃〃;WP1019!C'…2':C'…1';2;FALSE))〃
Summary。Range(Cells(TargetRow; 9); Cells(TargetRow; 9))。Select
ActiveCell。FormulaR1C1 = _
〃=SUMIF('IN1012'!C'2':C'3';Period!R2C2&〃〃06〃〃&RC'…8';'IN1012'!C'3')〃
Summary。Range(Cells(TargetRow; 10); Cells(TargetRow; 10))。Select
ActiveCell。FormulaR1C1 = _
〃=SUMIF('IN1012'!C'1':C'2';Period!R2C2&〃〃08〃〃&RC'…9';'IN1012'!C'2')〃
Summary。Range(Cells(TargetRow; 11); Cells(TargetRow; 11))。Select
ActiveCell。FormulaR1C1 = _
〃=IF(ISNA(VLOOKUP(RC'…10';Variance!C'…9':C'…7';2;FALSE))=TRUE;0;VLOOKUP(RC'…10';V
ariance!C'…9':C'…7';2;FALSE))〃
Summary。Range(Cells(TargetRow; 12); Cells(TargetRow; 12))。Select
Selection。FormulaR1C1 = _
〃=IF(ISNA(VLOOKUP(RC'…11';Variance!C'…10':C'…8';3;FALSE))=TRUE;0;VLOOKUP(RC'…11';
Variance!C'…10':C'…8';3;FALSE))〃
Summary。Range(Cells(TargetRow; 13); Cells(TargetRow; 13))。Select
Selection。F