- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 21# linsurvey2005
¦A¸Õ¸Õ¬Ý- Option Explicit
- Sub Selection_Copy()
- Dim fs As String, Nwb As Workbook, SourceWb As Workbook, R As Integer, k As Range, myfilename As String
- On Error GoTo 11 'µ{°õ¦æ¦¡¦p¦³¿ù»~.¨ì ¼Ð°O12:³B¸Ì
- fs = Application.GetOpenFilename("Excel ÀÉ®×(*.xls),*.xls")
- If fs = "False" Then Exit Sub
- Set SourceWb = Workbooks.Open(fs)
- Set k = Application.InputBox("¿ï¨ú¶É±×->¼[¬W½s¸¹,¨½µ{,¤è¦V¤Îªì¨ÏÈ,«e¦¸ºÊ´úÈ", Type:=8) 'ª«¥ó:Range:¦p¨ú®øInputBoxªº¿é¤J->k¤£¬°ª«¥ó¿ù»~È=1004
- Set Nwb = Workbooks.Add
- With Nwb.Sheets(1) 'ª«¥ó:·s¼W¬¡¶Ã¯ªº²Ä1Ó¤u§@ªí
- '·s¼W¬¡¶Ã¯®É,§@¥Î¤¤ªº¬¡¶Ã¯·|²¾¨ì¦¹·s¼W¬¡¶Ã¯
- SourceWb.Activate '§@¥Î¤¤ªº¬¡¶Ã¯:¦¹¬¡¶Ã¯(SourceWb)
- Do
- R = Application.Max(3, .Cells(.Rows.Count, 1).End(xlUp).Row + 1)
- k.Copy .Cells(R, 1) '½Æ»s©Ò¿ï°_ªºªº½d³ò
- If MsgBox("¬O§_Ä~Äò", vbYesNo) = vbNo Then Exit Do
- Set k = Application.InputBox("¿ï¨ú¶É±×->¼[¬W½s¸¹,¨½µ{,¤è¦V¤Îªì¨ÏÈ,«e¦¸ºÊ´úÈ", Type:=8) 'ª«¥ó:Range:¦p¨ú®øInputBoxªº¿é¤J->k¤£¬°ª«¥ó¿ù»~È=1004
- Loop
- 9:
- .Activate
- DoEvents
- myfilename = Format(Date, "yymmdd") & "-Tilt-PDA.xls"
- Application.SendKeys myfilename, True
- fs = Application.GetSaveAsFilename("E:\")
- If fs <> False Then .Parent.SaveAs fs
- .Parent.Close 0
- End With
- 10:
- SourceWb.Close 0
- Exit Sub
- 11:
- If Err = 424 Then
- If Nwb.Sheets(1).UsedRange.Rows.Count > 1 Then GoTo 9 '¤w¦³¿ï¾Ü½d³ò¹L:·s¼W¬¡¶Ã¯»Ý¦sÀÉ
- GoTo 10
- End If
- k.Select
- MsgBox "©Ò¿ïªº " & k.Areas.Count & " ½d³ò:¤£¦b¦P¤@¦C¤W,¦C¼Æ¤£¬Ûµ¥", , "¤£¥i½Æ»s!!"
- Resume Next '¦^¨ìµ{¦¡½X¿ù»~¦æªº¤U¤@¦æ
- End Sub
½Æ»s¥N½X |
|