¼ÐÃD:
[µo°Ý]
§R°£³¡¤À¤u§@ªí
[¥´¦L¥»¶]
§@ªÌ:
asch2007
®É¶¡:
2014-10-9 16:07
¼ÐÃD:
§R°£³¡¤À¤u§@ªí
§Ú§ân§R°£ªº¤u§@ªí¦WºÙ³£©ñ¦bAÄæ
¦ý¤£ª¾¨ºùئ³¿ù,Àµ½Ð¦U¦ì°ª¤â½ç±Ð
·P¿E¤£ºÉ
For Each sht In Worksheets
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
If sht.name = Cells(i, 1) Then
sht.Delete
End If
Application.DisplayAlerts = False
Next
Next
End Sub
½Æ»s¥N½X
§@ªÌ:
»k¥ú°j¯T
®É¶¡:
2014-10-9 17:59
¦^´_
1#
asch2007
³Â·Ð½Ð¸Ôz¡Aµ{¦¡°õ¦æ«á¡A§A·Qn§e²{ªºµ²ªG¡C
¤£µM·QÀ°¦£ªº¤H¡A¼g¥X¨Óªºµ{¦¡½X¡A¥i¯à·|¸ò§Anªºµ²ªG¡A¦³«Ü¤j¸¨®t
§@ªÌ:
GBKEE
®É¶¡:
2014-10-9 20:04
¦^´_
1#
asch2007
¸Õ¸Õ¬Ý
Option Explicit
Sub Ex()
Dim sht As Worksheet, i As Integer
Application.DisplayAlerts = False
With ActiveWorkbook
For Each sht In .Worksheets
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
If sht.Name = Cells(i, 1) And .Sheets.Count > 1 Then
'.Sheets.Count > 1 '¬¡¶Ã¯¥²¶·¦³¤@±iªº¤u§@ªí¦s¦b.
sht.Delete
End If
Next
Next
End With
End Sub
½Æ»s¥N½X
§@ªÌ:
asch2007
®É¶¡:
2014-10-13 11:16
¦^´_
2#
»k¥ú°j¯T
«Ü©êºp¨S»¡²M·¡
§Ú·Qn§R°£¦h¾lªº¤u§@ªí¡A¦ý¤£¬O¥þ§R
n§R°£¤u§@ªíªº¦WºÙ¡A©ñ¦b¥t¤@Ó¤u§@ªí¤¤
§ÚÀ|¸Õ¼g¤F¤@¬qµ{¦¡¡A°õ¦æ¤¤¶¡¦³¥X¿ù
¿ù»~°T®§¡G
°õ¦æ¶¥¬q¿ù»~'424':
¦¹³B»Ýnª«¥ó
°»¿ùµ²ªG°±¦b
If sht.name = Cells(i, 1) Then
¦ý§Ú¤£ª¾¿ù¨ºùØ
§Æ±æ¦U¦ì¤j¤j«üÂI°g¬z
·P¿E¤£ºÉ
§@ªÌ:
luhpro
®É¶¡:
2014-10-13 21:30
¥»©«³Ì«á¥Ñ luhpro ©ó 2014-10-13 21:32 ½s¿è
¦^´_
4#
asch2007
¨º¬O¦]¬° ¦b
sht.Delete
³o¤@¦æ®É sht ª«¥ó³Q§R±¼¤F.
¦ý¬O For Next °j°éÁÙ¬OÄ~Äò¦b°õ¦æ,
©ó¬O¶]¨ì
If sht.Name ...
³o¤@¦æ®É Sht ª«¥ó¤w¸g¤£¦s¦b©Ò¥H "§ä¤£¨ìª«¥ó".
©³¤U¨âºØ¤è¦¡³£¥i¥H¤£¦A¥X²{¦¹¿ù»~°T®§.
Application.DisplayAlerts = False
For Each sht In Worksheets
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
If Not IsEmpty(sht) Then
If sht.Name = Cells(i, 1) Then sht.Delete
End If
Next
Next
Application.DisplayAlerts = True
½Æ»s¥N½X
Application.DisplayAlerts = False
For Each sht In Worksheets
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
If sht.Name = Cells(i, 1) Then
sht.Delete
Exit For
End If
Next
Next
Application.DisplayAlerts = True
½Æ»s¥N½X
§@ªÌ:
Hsieh
®É¶¡:
2014-10-14 09:23
¦^´_
4#
asch2007
Sub ex()
Dim Sh As Worksheet
Set d = CreateObject("Scripting.Dictionary")
For Each Sh In Sheets
Set d(Sh.Name) = Sh '¼È¦s©Ò¦³¤u§@ªí
Next
With Sheets("¤u§@ªí1") '±ý§R°£¦W³æ¤u§@ªí
For Each a In .Range(.[A1], .Cells(.Rows.Count, 1).End(xlUp))
If d.exists(CStr(a)) = True Then d(CStr(a)).Delete '¬°¨¾¤î¥H¼Æ¦r¬°¦Wªº¤u§@ªí¡A¬G¨Ï¥ÎCstrÂন¦r¦ê
Next
End With
End Sub
½Æ»s¥N½X
§@ªÌ:
asch2007
®É¶¡:
2014-10-16 15:37
¦^´_
5#
luhpro
·PÁÂÀ°¦£¡A´ú¸Õµ²ªG²Ä¤@ÓÁÙ¬O¤£¦æ¡A¦ý²Ä¤GÓ¦¨¥\¡I¡I
§@ªÌ:
asch2007
®É¶¡:
2014-10-16 15:38
¦^´_
6#
Hsieh
´ú¸Õµ²ªGÁÙ¬O¦³°ÝÃD¡A§Ú¦A¬ã¨s¬Ý¬Ý
·PÁÂ
§@ªÌ:
asch2007
®É¶¡:
2014-10-16 15:49
[attach]19351[/attach]
¸g´ú¸Õµ²ªG¥u¦³"§Rªí¤G"¦¨¥\
¨ä¥L§Ú¦A¬ã¨s¬Ý¬Ý
§@ªÌ:
GBKEE
®É¶¡:
2014-10-16 19:47
¦^´_
9#
asch2007
Sub §Rªí()
Dim i As Integer, sht As Worksheet
Worksheets("§Rªí¦W³æ").Activate
Application.DisplayAlerts = False
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
For Each sht In Worksheets
If sht.name = Cells(i, 1) Then sht.Delete
Next
Next
Application.DisplayAlerts = True
End Sub
Sub §Rªí2()
Dim i As Integer, sht As Worksheet
Worksheets("§Rªí¦W³æ").Activate
Application.DisplayAlerts = False
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
For Each sht In Worksheets
If sht.name = Cells(i, 1) Then
sht.Delete
Exit For
End If
Next
Next
Application.DisplayAlerts = True
End Sub
Sub §Rªí3()
Dim Sh As Worksheet, d As Object, a As Range
Set d = CreateObject("Scripting.Dictionary")
For Each Sh In Sheets
Set d(Sh.name) = Sh '¼È¦s©Ò¦³¤u§@ªí
Next
Application.DisplayAlerts = False
With Sheets("§Rªí¦W³æ") '±ý§R°£¦W³æ¤u§@ªí
For Each a In .Range(.[A1], .Cells(.Rows.Count, 1).End(xlUp))
If d.exists(CStr(a)) = True Then d(CStr(a)).Delete '¬°¨¾¤î¥H¼Æ¦r¬°¦Wªº¤u§@ªí¡A¬G¨Ï¥ÎCstrÂন¦r¦ê
Next
End With
Application.DisplayAlerts = True
End Sub
Sub §Rªí_EX()
Dim i As Integer
Application.DisplayAlerts = False
With Worksheets("§Rªí¦W³æ")
On Error Resume Next
For i = 2 To .Range("A" & .Rows.Count).End(xlUp).Row
.Parent.Sheets(.Cells(i, 1).Value).Delete
Next
On Error GoTo 0
End With
Application.DisplayAlerts = True
End Sub
½Æ»s¥N½X
Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)