- ©«¤l
- 25
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 50
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 2007
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-1-22
- ³Ì«áµn¿ý
- 2014-4-29
|
[µo°Ý] ¨Ì·Ó¼ÐÃDÃöÁä¦r«ü©wÄæ¦ì±ø¥ó¦Ó§R°£¸ÓÄd
¥»©«³Ì«á¥Ñ billchenfantasy ©ó 2013-2-6 14:53 ½s¿è
½Ð°Ý
Sub «ö¶s1_Click()
Dim uFile$
Dim rng As Range
ChDrive "C:\"
ChDir "C:\Users\us\Desktop\"
Source = Application.GetOpenFilename(FileFilter:="Excel Files (*.xlsx),*.xlsx")
With Workbooks.Open(Source)
For i = 1 To ActiveWorkbook.Sheets.Count
.Sheets(i).Copy after:=ThisWorkbook.Worksheets(Sheets.Count)
Next i
.Close
End With
¥H¤U¬O±N§¹¥þ²Å¦X"PLAN_NO", "PlAN_DAT"ªº¼ÐÃD¨äÄæ¦ì§R¥h¡A¦ý¦]¬°¦³¨ÇÄæ¦ì¨ã¦³PLAN_NO_1,PLAN_NO_2......½Ð°Ýn¦p¦óק令²Å¦XÃöÁä¦r"PLAN_NO", "PlAN_DAT"ªºÄæ¦ì§R¥hªº¼gªk
With ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
For j = 1 To .[A1].CurrentRegion.Columns.Count
If IsError(Application.Match(.Cells(1, j).Value, Array("section", "PLAN_NO", "PlAN_DAT"), 0)) Then
If rng Is Nothing Then Set rng = .Columns(j) Else Set rng = Union(rng, .Columns(j))
End If
Next j
.Range(rng.Address).Delete Shift:=xlToLeft
Set rng = Nothing
End With
End Sub |
|