- ©«¤l
- 162
- ¥DÃD
- 44
- ºëµØ
- 0
- ¿n¤À
- 244
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-4-4
- ³Ì«áµn¿ý
- 2022-10-3
|
¥»©«³Ì«á¥Ñ jesscc ©ó 2011-5-7 18:23 ½s¿è
»¡±o¤]¬O¡A§Ú¤£ª¾¤£Ä±´N§â¤Hªº«ä¦Ò±a¶i¹q¸£ùؤF¡C
Hsieh ¤j¤j¥i¥H¦AÀ°§Ú¬Ý¤@¤U¶Ü?
¦b³Ì«á¡A°}¦CÂಾ»Ý¨Dªí¸ê®Æªº¦a¤è¥X²{°»¿ù!¥i¤£¥i¥HÀ°§ÚÀˬd¤@¤U¬Oþ¸Ì¿ù¤F¶Ü?¬O¦]¬°°}¦CµLªkÂಾ»Ý¨Dªíùتº¤½¦¡¶Ü?- Sub OpenFile1()
- FileToOpen = Application.GetOpenFilename _
- (Title:="¶}±Ò¥»¶g»Ý¨Dªí", _
- FileFilter:="Matl Request *.xls (*.xls),")
- If FileToOpen = False Then
- MsgBox "¥²¶·¶}±Ò »Ý¨Dªí¡A¤u§@¤~¯àÄ~Äò!", 48, "ÀÉ®×¥¼¶}±Ò"
- Exit Sub
- Else
- op = False
- fn = Split(FileToOpen, "\")(UBound(Split(FileToOpen, "\")))
- 'Var = MsgBox("½T©w¬O¶}±Ò³o¥÷»Ý¨Dªí¶Ü?", 36, "½Ð½T»{±ý¶}±Ò¤§ÀÉ®×")
- 'If Var = 6 Then
- For Each w In Windows 'ÀˬdÀɮ׬O§_¤w¶}±Ò
- If w.Caption = fn Then op = True: Exit For
- Next
- If op = False Then Workbooks.Open FileName:=FileToOpen '¦pªGµøµ¡¤¤¨S¦³¶}±Ò»Ý¨Dªí´N¶}±Ò»Ý¨Dªí
- Set aw = Workbooks(fn) '±N»Ý¨Dªí³]µ¹ª«¥óÅܼƥH§Q«áÄò¨Ï¥Î
- Workbooks("Main.xls").Activate
- Sheets("MRP").Range("D1").Value = fn '±N»Ý¨DªíÀɦW¼g¤JÀx¦s®æ
- 'Else
- End If
- '°}¦CÂಾ»Ý¨Dªí¸ê®Æ
- Workbooks(fn).Activate
- Dim Ay()
- For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
- For j = 2 To 14
- ReDim Preserve Ay(s)
- Ay(s) = Array(Cells(i, j).Value)
- s = s + 1
- Next j
- Next i
- Workbooks("Main.xls").Activate
- With Sheets("MRP")
- Cells(4, 14).NumberFormat = "dd/mm/yyyy"
- Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).Resize(s, 13) = Application.Transpose(Application.Transpose(Ay))
- End With
- End sub
½Æ»s¥N½X |
|