>即時新聞-熱門

2009年7月24日星期五

設計VBA的隱藏程式

Sub 隱C()

Columns("C:C").Select
Selection.EntireColumn.Hidden = True

End Sub
Sub 隱D()

Columns("D:D").Select
Selection.EntireColumn.Hidden = True

End Sub

Sub 隱E()

Columns("E:E").Select
Selection.EntireColumn.Hidden = True

End Sub
Sub 全部()
Columns("A:H").Select
Selection.EntireColumn.Hidden = False
Range("a1").Select

End Sub

Sub Product_Spec()
Range("a4").Select

While (ActiveCell.Value <> Empty)
If ActiveCell.Value <> "Product Spec & Scope" Then
x = ActiveCell.Row
x = x & ":" & x
Rows(x).Select
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select

End If

Wend


End Sub
Sub Payment_Term()
Range("a4").Select

While (ActiveCell.Value <> Empty)
If ActiveCell.Value <> "Payment Term" Then
x = ActiveCell.Row
x = x & ":" & x
Rows(x).Select
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select

End If

Wend


End Sub
Sub Payment_Type()
Range("a4").Select

While (ActiveCell.Value <> Empty)
If ActiveCell.Value <> "Payment Type" Then
x = ActiveCell.Row
x = x & ":" & x
Rows(x).Select
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select

End If

Wend


End Sub
Sub AR_Entity()
Range("a4").Select

While (ActiveCell.Value <> Empty)
If ActiveCell.Value <> "AR Entity" Then
x = ActiveCell.Row
x = x & ":" & x
Rows(x).Select
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select

End If

Wend


End Sub
Sub Reporting_Format()
Range("a4").Select

While (ActiveCell.Value <> Empty)
If ActiveCell.Value <> "Reporting Format" Then
x = ActiveCell.Row
x = x & ":" & x
Rows(x).Select
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select

End If

Wend


End Sub
Sub Audit_Term()
Range("a4").Select

While (ActiveCell.Value <> Empty)
If ActiveCell.Value <> "Audit Term" Then
x = ActiveCell.Row
x = x & ":" & x
Rows(x).Select
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select

End If

Wend


End Sub
Sub Termination()
Range("a4").Select

While (ActiveCell.Value <> Empty)
If ActiveCell.Value <> "Termination" Then
x = ActiveCell.Row
x = x & ":" & x
Rows(x).Select
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select

End If

Wend


End Sub
Sub all()


Rows("1:100").Select
Selection.EntireRow.Hidden = False

Range("a4").Select


End Sub

0 评论:

 
妹咕數位學園歡迎網友們來信指教 妹咕信箱