EXCELでのセルの選択状態をVBAで読むFor Each in Selectionとコピペできるメッセージを出力できるInputBox。
小さな積み重ねだけど、できると案外、嬉しくなる。
One day, some pieces got at work connect each other and then become a tips.
"For Each in Selection" picks selected cells with the selected order and "InputBox" enables to copy and paste the message output by Inputbox.
Very tiny things but it make me happy when it come up as new idea.
EXCELで選択している複数セル(文字列)を連結するVBA(マクロ)は、これ。
Here is the VBA which concatenates cells with the selected order.
EXCELのSelectionを使うので、セルを選択した順番をキープして、連結が行われます。
- Sub concatenate()
- For Each r In Selection
- streach = r.Value
- If strselect = "" Then
- strselect = streach
- Else
- strselect = strselect & " " & streach
- EndIf
- Next
- InputBox Prompt:="Please Copy and Paste", Default:= strselect
- End Sub
規則性がない、離れたセルも連結できますよ。
Selection of EXCEL enables to pick up cells with the selected order for any cells. without any rules and even distant cells.
0 件のコメント:
コメントを投稿