<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>テレポーターのブログ</title>
<link>https://ameblo.jp/stargate3/</link>
<atom:link href="https://rssblog.ameba.jp/stargate3/rss20.xml" rel="self" type="application/rss+xml" />
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
<description>ブログの説明を入力します。</description>
<language>ja</language>
<item>
<title>マウス操作</title>
<description>
<![CDATA[ <p>　　A　　　B　　　C　　　D　　　E</p><p>1　Rclick　983&nbsp;&nbsp; &nbsp;265　　　-　　asdfgh</p><p>2　sleep　500　　-　　　-　　asdrty</p><p>3　Lclick　653　774　　　-　　qwefgh</p><p>4　sleep　500　　-　　　-　　qwerty　　　</p><p>&nbsp;</p><div class="ogpCard_root"><article class="ogpCard_wrap" contenteditable="false" style="display:inline-block;max-width:100%"><a class="ogpCard_link" data-ogp-card-log="" href="https://www.moug.net/tech/exvba/0150091.html" rel="noopener noreferrer" style="display:flex;justify-content:space-between;overflow:hidden;box-sizing:border-box;width:620px;max-width:100%;height:120px;border:1px solid #e2e2e2;border-radius:4px;background-color:#fff;text-decoration:none" target="_blank"><span class="ogpCard_content" style="display:flex;flex-direction:column;overflow:hidden;width:100%;padding:16px"><span class="ogpCard_title" style="-webkit-box-orient:vertical;display:-webkit-box;-webkit-line-clamp:2;max-height:48px;line-height:1.4;font-size:16px;color:#333;text-align:left;font-weight:bold;overflow:hidden">クリップボードとデータのやりとりをする：Excel VBA｜即効テクニック｜Excel VBAを学ぶならmoug</span><span class="ogpCard_url" style="display:flex;align-items:center;margin-top:auto"><span class="ogpCard_iconWrap" style="position:relative;width:20px;height:20px;flex-shrink:0"><img alt="リンク" class="ogpCard_icon" height="20" loading="lazy" src="https://c.stat100.ameba.jp/ameblo/symbols/v3.20.0/svg/gray/editor_link.svg" style="position:absolute;top:0;bottom:0;right:0;left:0;height:100%;max-height:100%" width="20"></span><span class="ogpCard_urlText" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#757575;font-size:12px;text-align:left">www.moug.net</span></span></span></a></article></div><p>&nbsp;</p><div class="ogpCard_root"><article class="ogpCard_wrap" contenteditable="false" style="display:inline-block;max-width:100%"><a class="ogpCard_link" data-ogp-card-log="" href="https://www.vector.co.jp/soft/winnt/util/se487144.html" rel="noopener noreferrer" style="display:flex;justify-content:space-between;overflow:hidden;box-sizing:border-box;width:620px;max-width:100%;height:120px;border:1px solid #e2e2e2;border-radius:4px;background-color:#fff;text-decoration:none" target="_blank"><span class="ogpCard_content" style="display:flex;flex-direction:column;overflow:hidden;width:100%;padding:16px"><span class="ogpCard_title" style="-webkit-box-orient:vertical;display:-webkit-box;-webkit-line-clamp:2;max-height:48px;line-height:1.4;font-size:16px;color:#333;text-align:left;font-weight:bold;overflow:hidden">MPP Utilityの詳細情報 : Vector ソフトを探す！</span><span class="ogpCard_description" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.6;margin-top:4px;color:#757575;text-align:left;font-size:12px">マウスポインタ位置情報に関した様々な機能を提供する統合ユーティリティ</span><span class="ogpCard_url" style="display:flex;align-items:center;margin-top:auto"><span class="ogpCard_iconWrap" style="position:relative;width:20px;height:20px;flex-shrink:0"><img alt="リンク" class="ogpCard_icon" height="20" loading="lazy" src="https://c.stat100.ameba.jp/ameblo/symbols/v3.20.0/svg/gray/editor_link.svg" style="position:absolute;top:0;bottom:0;right:0;left:0;height:100%;max-height:100%" width="20"></span><span class="ogpCard_urlText" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#757575;font-size:12px;text-align:left">www.vector.co.jp</span></span></span></a></article></div><p>&nbsp;</p><p>ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー</p><p>Private Type Position<br>&nbsp; &nbsp; x As Long<br>&nbsp; &nbsp; y As Long<br>End Type<br>Declare Function SetCursorPos Lib "User32" (ByVal x As Long, ByVal y As Long) As Long<br>Declare Sub mouse_event Lib "User32" ( _<br>&nbsp; &nbsp; ByVal dwFlags As Long, _<br>&nbsp; &nbsp; Optional ByVal dx As Long = 0, _<br>&nbsp; &nbsp; Optional ByVal dy As Long = 0, _<br>&nbsp; &nbsp; Optional ByVal dwDate As Long = 0, _<br>&nbsp; &nbsp; Optional ByVal dwExtraInfo As Long = 0)<br>Declare Function GetCursorPos Lib "User32" (lpPoint As Position) As Long<br>Private Declare Sub Sleep Lib "kernel32" (ByVal ms As Long)</p><p>ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー<br>Sub LeftClick()<br>&nbsp; &nbsp; mouse_event 2<br>&nbsp; &nbsp; mouse_event 4<br>End Sub</p><p>ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー<br>Sub RightClick()<br>&nbsp; &nbsp; mouse_event 8<br>&nbsp; &nbsp; mouse_event 16<br>End Sub<br>ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー<br>Sub Sample2()<br>&nbsp; &nbsp; Dim WSH As Object<br>&nbsp; &nbsp; Set WSH = CreateObject("WScript.Shell")<br>&nbsp; &nbsp; WSH.Popup "5秒後、自動的に閉じます", 1, "Title", vbInformation<br>&nbsp; &nbsp; Set WSH = Nothing<br>End Sub</p><p>ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー<br>Sub 座標を調べる()<br>&nbsp; &nbsp; Dim pos As Position<br>&nbsp; &nbsp; Call GetCursorPos(pos)<br>&nbsp; &nbsp; Debug.Print pos.x, pos.y<br>&nbsp; &nbsp; MsgBox pos.x &amp; ", " &amp; pos.y<br>End Sub</p><p>ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー</p><p>Sub メイン操作()<br>Application.ScreenUpdating = False</p><p><br>goal = Cells(Rows.Count, 5).End(xlUp).Row</p><p><br>For st = 1 To goal<br>&nbsp; &nbsp; Dim buf As String, buf2 As String, CB As New DataObject<br>&nbsp; &nbsp; buf = Cells(st, 5).Value<br>&nbsp; &nbsp; With CB<br>&nbsp; &nbsp; &nbsp; &nbsp; .SetText buf &nbsp; &nbsp; &nbsp; &nbsp;''変数のデータをDataObjectに格納する<br>&nbsp; &nbsp; &nbsp; &nbsp; .PutInClipboard &nbsp; &nbsp; ''DataObjectのデータをクリップボードに格納する<br>&nbsp; &nbsp; End With<br>&nbsp; &nbsp; &nbsp; &nbsp; For turn = 1 To Cells(Rows.Count, 1).End(xlUp).Row<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t = Cells(turn, 1).Value<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x = Cells(turn, 2).Value<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y = Cells(turn, 3).Value<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Select Case t<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Case "sleep"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sleep (x)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Case "Lclick"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetCursorPos x, y &nbsp;'調べておいた座標を入力<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LeftClick<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Case "Rclick"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetCursorPos x, y &nbsp;'調べておいた座標を入力<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RightClick<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Case "sendkey"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SendKeys "ABC"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End Select<br>&nbsp; &nbsp; &nbsp; &nbsp; Next<br>&nbsp; &nbsp; Dim WSH As Object<br>&nbsp; &nbsp; Set WSH = CreateObject("WScript.Shell")<br>&nbsp; &nbsp; WSH.Popup st &amp; "/" &amp; goal &amp; "完了！！", 1, "Title", vbInformation<br>&nbsp; &nbsp; Set WSH = Nothing<br>Next</p><p><br>MsgBox "全" &amp; goal &amp; "回　完了！！"<br>Application.ScreenUpdating = True<br>End Sub</p><p>ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー</p><p>Sub 文字列パターン()<br><br>'各列最終行取得<br>a = Cells(Rows.Count, 1).End(xlUp).Row<br>b = Cells(Rows.Count, 2).End(xlUp).Row<br>c = Cells(Rows.Count, 3).End(xlUp).Row<br><br>'1行目から各列最終行まで繰り返し<br>For st = 1 To a<br>&nbsp; &nbsp; For nd = 1 To b<br>&nbsp; &nbsp; &nbsp; &nbsp; For rd = 1 To c<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x = x + 1<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Cells(x, 5) = Cells(st, 1) &amp; Cells(nd, 2) &amp; Cells(rd, 3) 'E列に結合して転記<br>&nbsp; &nbsp; &nbsp; &nbsp; Next rd<br>&nbsp; &nbsp; Next nd<br>Next st<br><br>End Sub</p><p>ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー</p>
]]>
</description>
<link>https://ameblo.jp/stargate3/entry-12752317685.html</link>
<pubDate>Fri, 08 Jul 2022 02:24:41 +0900</pubDate>
</item>
</channel>
</rss>
