{"id":1098,"date":"2019-06-15T19:06:10","date_gmt":"2019-06-15T10:06:10","guid":{"rendered":"https:\/\/vongg.com\/?p=1098"},"modified":"2019-06-17T13:50:03","modified_gmt":"2019-06-17T04:50:03","slug":"excel-macro-%e4%be%bf%e5%88%a9%e3%83%84%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/vongg.com\/?p=1098","title":{"rendered":"excel macro \u4fbf\u5229\u30c4\u30fc\u30eb"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>ctrl+r \u8d64\u6587\u5b57 \nctrl+b \u9752\u6587\u5b57 \nctrl+y \u9ec4\u8272\u7db2\u639b\u3051 \nctrl+q \u8272\u3092\u30af\u30ea\u30a2 \nctrl+g \u30b0\u30ec\u30a4\u7db2\u639b\u3051 \nctrl+u a=>A \nctrl+d A=>a \n\n\n\n\n\nSub Macro1()\n\u2018\n \u2018 Macro1 Macro\n\u2018\n \u2018 Keyboard Shortcut: Ctrl+r\n\u2018\nWith Selection.Font\n .Color = -16776961\n .TintAndShade = 0\n End With\n End Sub\n Sub Macro2()\n\u2018\n \u2018 Macro2 Macro\n\u2018\n \u2018 Keyboard Shortcut: Ctrl+b\n\u2018\nWith Selection.Font\n .Color = -4165632\n .TintAndShade = 0\n End With\n End Sub\n Sub Macro3()\n\u2018\n \u2018 Macro3 Macro\n\u2018\n \u2018 Keyboard Shortcut: Ctrl+y\n\u2018\nWith Selection.Interior\n .Pattern = xlSolid\n .PatternColorIndex = xlAutomatic\n .Color = 65535\n .TintAndShade = 0\n .PatternTintAndShade = 0\n End With\n End Sub\n Sub Macro4()\n\u2018\n \u2018 Macro4 Macro\n\u2018\n \u2018 Keyboard Shortcut: Ctrl+q\n\u2018\nWith Selection.Interior\n .Pattern = xlNone\n .TintAndShade = 0\n .PatternTintAndShade = 0\n End With\n With Selection.Font\n .ColorIndex = xlAutomatic\n .TintAndShade = 0\n End With\n End Sub\n\nSub Macro5()\n\u2018\n \u2018 Macro5 Macro\n\u2018\n \u2018 Keyboard Shortcut: Ctrl+g\n\u2018\nWith Selection.Interior\n.Pattern = xlSolid\n.PatternColorIndex = xlAutomatic\n.ThemeColor = xlThemeColorDark1\n.TintAndShade = -0.349986266670736\n.PatternTintAndShade = 0\nEnd With\n End Sub\n\nSub Macro6()\n\u2018\n \u2018 Macro6 Macro\n\u2018\n \u2018 Keyboard Shortcut: Ctrl+u\n\u2018\n\u2018 \u5909\u6570\u5b9a\u7fa9\nDim targetCell As Range\n' \u9078\u629e\u3057\u305f\u30bb\u30eb\u7bc4\u56f2\u3092\u9806\u6b21\u51e6\u7406\nFor Each targetCell In Selection.Cells\n\n    ' \u5927\u6587\u5b57\u306b\u5909\u63db\n    targetCell.Value = StrConv(targetCell.Value, vbUpperCase)\n\nNext\n\nEnd Sub\n\nSub Macro7()\n\u2018\n \u2018 Macro7 Macro\n\u2018\n \u2018 Keyboard Shortcut: Ctrl+d\n\u2018\n\u2018 \u5909\u6570\u5b9a\u7fa9\nDim targetCell As Range\n' \u9078\u629e\u3057\u305f\u30bb\u30eb\u7bc4\u56f2\u3092\u9806\u6b21\u51e6\u7406\nFor Each targetCell In Selection.Cells\n\n    ' \u5c0f\u6587\u5b57\u306b\u5909\u63db\n    targetCell.Value = StrConv(targetCell.Value, vbLowerCase)\n\nNext\n\nEnd Sub\n\n\nSub Macro8()\n'\n' Macro8 Macro\n'aaa_bbb=>aaaBbb\n' Keyboard Shortcut: Ctrl+j\n'\n   ' \u5909\u6570\u5b9a\u7fa9\n    Dim targetCell As Range\n    Dim str As String\n    Dim strDe As String\n    Dim i As Long\n    ' \u9078\u629e\u3057\u305f\u30bb\u30eb\u7bc4\u56f2\u3092\u9806\u6b21\u51e6\u7406\n    For Each targetCell In Selection.Cells\n         strDe = \"\"\n         str = \"\"\n         str = targetCell.Value\n         For i = 1 To Len(str)\n           If Mid(str, i, 1) = \"_\" Then\n                i = i + 1\n                strDe = strDe &amp; StrConv(Mid(str, i, 1), vbUpperCase)\n                'StrConv(targetCell.Value, vbUpperCase)\n           Else\n            strDe = strDe &amp; Mid(str, i, 1)\n           End If\n           \n         Next i\n        \n        ' \u5c0f\u6587\u5b57\u306b\u5909\u63db\n        targetCell.Value = strDe\n    Next\nEnd Sub\n\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[130],"tags":[],"_links":{"self":[{"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts\/1098"}],"collection":[{"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1098"}],"version-history":[{"count":2,"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts\/1098\/revisions"}],"predecessor-version":[{"id":1104,"href":"https:\/\/vongg.com\/index.php?rest_route=\/wp\/v2\/posts\/1098\/revisions\/1104"}],"wp:attachment":[{"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vongg.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}