ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð±Ð¦p¦ó¨Ï¥Îvba¹M¾ú¦U¤u§@ªí¤§¬Û¦P½d³ò¤º®eCOPY¦Ü¥D­¶¨Ã¾A®É·s¼WColumns¼Æ

[µo°Ý] ½Ð±Ð¦p¦ó¨Ï¥Îvba¹M¾ú¦U¤u§@ªí¤§¬Û¦P½d³ò¤º®eCOPY¦Ü¥D­¶¨Ã¾A®É·s¼WColumns¼Æ

Dear ª©¥D©Î¦U¦ì¤j¤j­Ì :
¤p§Ì¦]¬°sheet¤W¤è·|¦³¨Ç¹Ïªí,³]©w¬°¤£ÀHÀx¦s®æ¤j¤p§@ÅÜ°Ê,¦ý¤S»Ý¨ú±o¨ä¥¦sheet¤§¸ê®Æ(¨ä¨Ó·½¦æ¦C¼Æ·|ÅÜ°Ê),¬O§_¥i¥H¨C­ÓSheet¤§¬Û¦P¦ì§}b2:p12,¤À§O½Æ»s¸ê®Æ¦ÜSheet1 b5¦ì§}¶}©l,¦p¹JÄæ¦ì¼Æ¤£¨¬,¦Û°Ê·s¼W¨Ó·½¤§columns¼Æ,¨C±Æ¶È¯à¦³¤T­Ó½d³ò¸ê®Æ,²Ä¥|­Ó«h¸õ²Ä¤G±Æ,ª½¦Üµ²§ô




Get each sheet data to mainsheet_2013-01-23.zip (27 KB)

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2013-1-24 19:16 ½s¿è

¦^´_ 1# cmo140497
1.
>>¦p¹JÄæ¦ì¼Æ¤£¨¬,¦Û°Ê·s¼W¨Ó·½¤§columns¼Æ,
±Ô­z¬Ý¤£À´

2.
>>¨C±Æ¶È¯à¦³¤T­Ó½d³ò¸ê®Æ,²Ä¥|­Ó«h¸õ²Ä¤G±Æ
Àɮ׸ò¹Ï¤WÅã¥Üªº¬O
¶È¦³¤G­Ó½d³ò¸ê®Æ,²Ä¤T­Ó«h¸õ²Ä¤G±Æ
   
3.
¤£¹L§Ú¤j¸Ó¥i¥H²q¥X§A­n¬Æ»ò...
¸Õ¬Ý¬Ý..
  1. Sub Test()
  2. Dim vCols As Long, cIndex As Long, rIndex As Long
  3. Dim first As Long, last As Long
  4. Dim sCopy As String
  5. Dim r, c

  6. first = 2   'from T02 , ¥i¦Û¦æ½Õ¾ã
  7. last = 5    'to   T05 , ¥i¦Û¦æ½Õ¾ã
  8. sCopy = "B2:P12"       '¥i¦Û¦æ½Õ¾ã

  9. r = Range(sCopy).Rows.Count + 1     '¨C°Ï¶ô¦C¼Æ,+1¦C¼ÐÃD(Wafer TXX)
  10. c = Range(sCopy).Columns.Count + 1  '¨C°Ï¶ôÄæ¼Æ,+1ÄæªÅ¥Õ

  11. '¥i¨£ªºÄæ¼ÆÁ`¼Æ
  12. vCols = Sheets("sheet1").Cells.SpecialCells(xlCellTypeVisible).Columns.Count

  13. For i = first To last
  14.     rIndex = Int((i - first) / Int(vCols / c))
  15.     cindex = (i - first) Mod Int(vCols / c)
  16.    
  17.     With Sheets("sheet1").[B5].Offset(r * rIndex, c * cindex)
  18.         .Offset(-1, 1).Value = "WAFER"
  19.         .Offset(-1, 2).Value = "T" & Format(i, "00")
  20.         Sheets("T" & Format(i, "00")).Range(sCopy).Copy .Cells(1, 1)    '½d³ò½Æ»s[B2:P12],§t®æ¦¡
  21.     End With
  22. Next i
  23. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# stillfish00


    ±z¹ê¦b¤Ó¯«¤F,¤p§Ì¸£µ¬¤Ó¦º¤F,¨ä¹ê¥Hª©­±¬°¥D¤~¹ï,¤£À³¸Ó¥Î¥H·s¼WCOLUMNS¼Æ,¹ê¦b¤Ó·PÁ±z¤F,·P®¦!

TOP

¦^´_ 2# stillfish00


    ¤£¦n·N«ä,¤p§ÌÁÙ¦³¤@­Ó°ÝÃD§Ñ¤F´£°Ý,¨º´N¬O°²¦pSheets name¤]¤£³£¬OT¶}ÀY,Sheets¼Æ¤]¤£¤Ó¤@©w¥u¦³4­Ó,¤p§Ìª¾¹D­n¦p¦ócount sheets,¦ý¤]¦p¦óÁקK¨ä¥¦¤G­¶¤]³Qcopy¶i¨Ó,½Ð°Ý­n¦p¦ó­×¥¿¬°°ÊºA,¹ê¦b¦A³Â·Ð±z¤©¥H«ü¾É,·P®¦!

TOP

¦^´_ 4# cmo140497
¯àÁ|­Ó¨Ò¶Ü?
>>ÁקK¨ä¥¦¤G­¶¤]³Qcopy¶i¨Ó
­þ¨â­¶? ¦³sheet name©M sheet¦ì¸m¶¶§Ç¶Ü?
³o¨â­¶¥~ªº³£­ncopy¶Ü?

TOP

¦^´_ 5# stillfish00

¤£¦n·N«ä,´Nmain & cals ³o¨â­Ósheet¸ê®Æ©È·|³Qcopy¶i¨Ó,¥t¦pªG¨ä¥¦sheet name¤£¬O01.02.03ªº§Ç¦C,¤£ª¾­n¦p¦ó¥N¤J,¦A·Ð½Ð±z«ü¾É,·P®¦!


    Get each sheet data to mainsheet_¤w¦^ÂÐ.zip (36.29 KB)

TOP

[/code][b]¦^´_ [url=http://forum.twbts.com/redirect.php?goto=findpost&pid=50094&ptid=8871]6#[/url] [i]cmo140497[/i] [/b]

¤£¦n·N«ä,¤p§Ì¸Õ¥X¨Ó¤F,¥Îworksheets(index)´NOK¤F,¤£¹L¤´·PÁ±zªº«üÂI°g¬z,·P®¦!

[code]Sub Test()
Dim vCols As Long, cIndex As Long, rIndex As Long
Dim first As Long, last As Long
Dim sCopy As String
Dim r, c
Dim myshtc As Long

Worksheets(1).Rows("48:99").Clear

myshtc = ThisWorkbook.Sheets.Count

first = 3   
last = myshtc   
sCopy = "B6:P16"      

r = Range(sCopy).Rows.Count + 1     
c = Range(sCopy).Columns.Count + 1  

'¥i¨£ªºÄæ¼ÆÁ`¼Æ
vCols = Sheets("DashBoard").Cells.SpecialCells(xlCellTypeVisible).Columns.Count

For i = first To last
    rIndex = Int((i - first) / Int(vCols / c))
    cIndex = (i - first) Mod Int(vCols / c)
    newR = r * rIndex
    newC = c * cIndex
   
    With Sheets("DashBoard").[R50].Offset(newR, newC)
        .Offset(-1, 1).Value= "ID"        
        .Offset(-1, 2).Value = Worksheets(i).Name        
        Worksheets(i).Range(sCopy).Copy .Cells(1, 1)   
    End With
Next i
End Sub

TOP

¦^´_ 7# cmo140497
¸ê®Æ¨S¯Ê¶Ü?
With Sheets("DashBoard").[R50].Offset(newR, newC)   
R50¬°°_©lÂI ,  vColsÀ³©w¬°
vCols = Sheets("DashBoard").Cells.SpecialCells(xlCellTypeVisible).Columns.Count-49
°£«D§AA:Q³£ÁôÂÃ

TOP

¦^´_ 7# cmo140497
  1. Sub ex()
  2. With Sheets("summary")
  3. s = .Cells.SpecialCells(xlCellTypeVisible).Columns.Count - 2
  4. .Cells = ""
  5. a = 2: b = 4 '¼g¤Jªº²Ä¤@­Ó¦ì¸m
  6.    For Each sh In Sheets
  7.        If sh.Name <> .Name And sh.Name <> "cals" Then '±Æ°£¤£¼g¤Jªº¤u§@ªí
  8.        ar = sh.Range("A1").CurrentRegion.Offset(, 1).Value '©Ò¦³¸ê®Æ½d³ò
  9.            ar(1, 2) = ar(1, 1): ar(1, 1) = sh.[A1].Value '§ó§ï°}¦C¤º®e
  10.            r = Int(n / Int(s / (UBound(ar, 2) - 1))) * (UBound(ar, 1) - 1) + b
  11.            k = (n Mod Int(s / (UBound(ar, 2) - 1))) * (UBound(ar, 2) - 1) + a
  12.            n = n + 1 '­pºâ¤u§@ªí¼Æ¶q
  13.            .Cells(r, k).Resize((UBound(ar, 1) - 1), (UBound(ar, 2) - 1)) = ar
  14.        End If
  15.    Next
  16. End With
  17. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD