LoginSignup
0
0

More than 3 years have passed since last update.

Excelのカラムを Ctrl + C した後、%Clipboard% を正規表現で/r /nを削除し「データ」をIf文で使えるようにする

Posted at

msgbox,Excelプログラム By SKojima@kuhen.org Ver.2020-12-01
msgbox,【F1】を押す「カラム」にデータがあれば表示

F1::

Gosub, Test1
Exit

Test1:

Clipboard=

send,{Down}

sleep,100

send,^c

ClipWait

Svar=%Clipboard%

sleep,100

;-------------------------------------------------------------------
; データの最後にある \r \n を正規表現で削除して空白かどうか判断する
;-------------------------------------------------------------------
Svar := RegExReplace(Svar,"`r`n", "")

If (Svar = "" )
{
  send,{ESC}
  sleep,100
}
else
{
  MsgBox, データは %Svar% です

  send,{ESC}
  sleep,100
}

Return

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0