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

[µo°Ý] Ãö©óEXCEL VBA ¥~³¡µøµ¡ ¶K¤W°ÝÃD½Ð¯q

[µo°Ý] Ãö©óEXCEL VBA ¥~³¡µøµ¡ ¶K¤W°ÝÃD½Ð¯q

¦³°µ¤@­ÓEXCEL VBA¡AÀɮצp¤U¡C
QAA.rar (13.49 KB)

§Ú¦³¶}±Ò¨â­Óµøµ¡¡A¤@­Ó¬O¤W­±´£¨ÑªºEXCELÀɮסA¸Ì­±¦³¤@­Ó«ö¶s¡A«ö¤U¥i¥H½Æ»sµM«áÁY¤pEXCELµøµ¡¡C


¥t¤@­Óµøµ¡¬O°O¨Æ¥»¡A¥Ø«e·Q­nÅýEXCEL¤ºAA¤u§@ªíªº¼Æ¾Ú¡A¶K¦b°O¨Æ¥»¤W¡AÃþ¦üCTRL+Vªº·Pı¡A½Ð°Ý¸Ó¦p¦ó¥HVBA§e²{?

¥»©«³Ì«á¥Ñ samwang ©ó 2021-11-3 12:32 ½s¿è

¦^´_ 1# zz0660

¥t¥~·s¼W¤å¦rÀÉ¡AµM«á±N¸ê®Æ¼g¤J¡AÁÂÁ¡C
Sub test()
Dim fs As Object, a As Object, R As Range
Application.ScreenUpdating = False
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("D:\" & 1 & ".txt")
For Each R In [A2:A32]
    a.WriteLine (R)
Next
a.Close
Application.ScreenUpdating = True
End Sub

TOP

¦^´_ 2# samwang

samwang¤j¤j¡A¦³¨S¦³§Oªº¤èªk©O?  ¤£­n¥t¥~·s¼W¤å¦rÀÉ¡AµM«á±N¸ê®Æ¼g¤Jªº¤è¦¡¡C

¹³¬O¦Û°ÊÀ°§Ú­Ì«ö CTRL+V ³o¼Ë?

TOP

¦^´_ 3# zz0660

¦³¨S¦³§Oªº¤èªk©O?  ¤£­n¥t¥~·s¼W¤å¦rÀÉ¡AµM«á±N¸ê®Æ¼g¤Jªº¤è¦¡¡C
>>Set a = fs.CreateTextFile("D:\" & 1 & ".txt")
ª½±µ±N 1 §ï¬°±z¥Ø«eªº¤å¦rÀɪº¦WºÙ¡A³o¼Ë´N¥i¥H¤F
¦Ü©ó±z´£ªº»Ý¨D¡Aª½±µ¶K¨ì¥t¤@­Óµøµ¡ªº¤å¦rÀÉ¡A«á¾Ç¨S¦³·Q¨ì¸Ñªk¡AÁÂÁÂ

TOP

¦^´_ 3# zz0660


¥t¤@­Ó·Qªk¡AÅý¨Ï¥ÎªÌ¿ï¨úÀÉ®×(¥i¦P®É¿ï¾Ü¦h­Ó)¡A½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁ¡C

Sub test1()
Dim fs, f, R As Range, fc%, x%
Application.ScreenUpdating = False
Set fs = CreateObject("Scripting.FileSystemObject")
With Application.FileDialog(msoFileDialogOpen)
    .InitialFileName = "D:\"
    .AllowMultiSelect = True
    .Show
    fc = .SelectedItems.Count
    If fc = 0 Then Exit Sub
    For x = 1 To fc
        FPath = .SelectedItems(x)
        Set f = fs.OpenTextFile(FPath, 2) '8:«O¯d­ì¸ê®Æ¡F2:²M°£­ì¸ê®Æ
        For Each R In [A2:A32]: f.WriteLine (R): Next
        f.Close
    Next
End With
Set fs = Nothing: Set f = Nothing
Application.ScreenUpdating = True
End Sub

TOP

¥»©«³Ì«á¥Ñ quickfixer ©ó 2021-11-3 17:00 ½s¿è

¦^´_ 3# zz0660

³o¸Ì§Û¨Óªº,­ì¤åºô§}
§Arun¬Ý¬Ý,¹³³o¼Ë¶Ü?¬í¼Æ¦Û¤v½Õ¾ã

    Sub Copy()

Dim file_name As String

Range("A2:A32").Copy
ActiveWindow.WindowState = xlMinimized

Delay (1) 'µ¥1¬í

file_name = "C:\Windows\system32\notepad.exe" '°O¨Æ¥»¶}·s¤å¥ó
Shell file_name, vbNormalFocus
AppActivate "¥¼©R¦W - °O¨Æ¥»" '°O¨Æ¥»µøµ¡ªº¼ÐÃD
Delay (3) 'µ¥3¬í

SendKeys "{ENTER}", True 'ctrl+v¤§«e­n¥ýÀH«K¿é¤J­ÓªF¦è
SendKeys "{BACKSPACE}", True
Delay (0.3) 'µ¥0.3¬í

SendKeys "^V", True


End Sub

Sub Delay(setdelay As Single)

Dim StartTime As Double, NowTime As Double
StartTime = Timer * 100
setdelay = setdelay * 100
Do
NowTime = Timer * 100
DoEvents
Loop Until NowTime - StartTime > setdelay


End Sub

TOP

¦^´_ 6# quickfixer


    ¸É¥R¤@¤U¶}ÂÂÀɪº¤èªk,¹³¬Oc:\test.txtÀÉ
file_name = "C:\Windows\system32\notepad.exe" & " " & "c:\test.txt" '°õ¦æÀÉÀɦW+ÂÂÀɸô®|ÀɦW
Shell file_name, vbNormalFocus
AppActivate "test - °O¨Æ¥»" '¼ÐÃD­n§ï
ª`·N,¼ÐÃD¤£¤@©wªø³o¼Ë,­n¬Ý§Aªºµe­±¬°¥D

TOP

¦^´_ 5# samwang

·PÁ samwang & quickfixer ¤j¤jªº¼ö¤ß¨ó§U³B²z°ÝÃD¡C
¥Ø«e¥»¤H¤w¸Õ¥XVBA·Q­n§e²{ªº¤è¦¡¡A¦p¤U¡õ

Sub Copy()

    [A2:A32].Copy
  
    ActiveWindow.WindowState = xlMinimized
   
    AppActivate "¥¼©R¦W - °O¨Æ¥»"

    SendKeys "^V", True


End Sub

¬õ¦r¬°°l¥[ªº³¡¥÷¡A³o­Ó´N¬Oºî¦X¨â¦ì¤j¤j´£¨Ñªº·Qªk¨Ó§ï¡A¦A¦¸·PÁÂ!

TOP

        ÀR«ä¦Û¦b : ºÉ¦h¤Ö¥»¥÷¡A´N±o¦h¤Ö¥»¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD