- ©«¤l
- 4
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 7
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2016-3-25
- ³Ì«áµn¿ý
- 2016-4-9
|
§Ú¦³¤@ÓÀɮסA¸Ì±¦³¼ÆÓsheet¡A»Ýn¥H¦UÓsheet¤ºªºC3¬°©R¦W«Ø¥ß¼ÆÓ¸ê®Æ§¨¡A¦A§â¥¦Ì¥þ³¡¥á¤J¥HQ3¬°©R¦Wªº¸ê®Æ§¨¤º¡A§Ú°Å°Å¶K¶K«á±o¨ì¤F§Únªº®ÄªG¡A¥i¬O¥¦Ì¥þ³¡³£¥á¦b®à±¡A¨Ã¨S¦³¥þ³¡³£³£¤J¥HQ3¬°¦Wªº¸ê®Æ§¨¤º
Sub LL()
Sheets.Add
Sheets("Sheet1").Name = "TOTAL"
Sheets("TOTAL").Move Before:=Sheets(1)
Dim i, j As String
Dim sh As String
i = 1 'total sheet ±q²Ä¤G¦C¶}©l
For n = 1 To ActiveWorkbook.Sheets.Count 'Á`¦@¦³´X±isheet
sh = "N" '¤u§@ªí¦WºÙ
Worksheets(n).Select '¿ï¾Ü¬Y¶¤u§@ªí
Value1 = Range("C3").Value '»Ý·JÁ`ªºÀx¦s®æȤÀ§O©ñ¤J¦UÓÅܼÆ
Worksheets("TOTAL").Select '¿ï¾ÜTOTAL sheet
Range("A" & i).Value = Value1 '±N¦UÓÅܼÆȤÀ§O©ñ¤JÀx¦s®æ¦ì¸m
i = i + 1 '·JÁ`¶total©¹¤U·s¼W¤@¦C N¶©ú²Óªí´N¦³N¦C¸ê®Æ
Next
Cells.Replace What:=" ", Replacement:="-", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Cells.Replace What:="--", Replacement:="-", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Cells.Replace What:="/", Replacement:="(", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Cells.Replace What:="-(", Replacement:="(", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
For i = 2 To n - 1
Range("A" & i).Value = Range("A" & i).Value & ") PCS"
Next
Cells.Replace What:="-)", Replacement:=")", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Sheets("1").Select
Range("Q3").Copy
Sheets("TOTAL").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Dim strPath, strFolderName
Dim objFS, objFloder, objFC
strPath = "C:\Users\tod210\Desktop\"
strFolderName = Range("A1").Value
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(strPath)
Set objFC = objFolder.SubFolders
objFC.Add (strFolderName)
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Dim folder As String
folder = ThisWorkbook.Path & "\"
Dim NX As Long, X As Long, NM As String
NX = [A65536].End(xlUp).Row
For X = 2 To NX
NM = Cells(X, 1).Value
If NM = "" Then GoTo nextname
FSO.CreateFolder (folder & NM)
nextname:
Next
End Sub |
-
-
061025.rar
(13.5 KB)
|