{"id":4653,"date":"2016-11-30T13:53:25","date_gmt":"2016-11-30T04:53:25","guid":{"rendered":"http:\/\/auctionpro.co.kr\/?p=4653"},"modified":"2017-01-04T19:10:02","modified_gmt":"2017-01-04T10:10:02","slug":"excel-vba-%ed%99%9c%ec%9a%a9%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=4653","title":{"rendered":"Excel VBA  \ud65c\uc6a9\ud558\uae30"},"content":{"rendered":"<p>vb \ubc30\uc6b4\uac70 \uc368\uba39\uc744 \ub54c\uac00 \ub9ce\ub124\uc694.<\/p>\n<p><a href=\"https:\/\/auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/VBA01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4654\" src=\"https:\/\/auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/VBA01.png\" alt=\"vba01\" width=\"1062\" height=\"690\" srcset=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/VBA01.png 1062w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/VBA01-300x195.png 300w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/VBA01-768x499.png 768w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/VBA01-1024x665.png 1024w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/VBA01-150x97.png 150w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/VBA01-400x260.png 400w\" sizes=\"auto, (max-width: 1062px) 100vw, 1062px\" \/><\/a><\/p>\n<pre class=\"prettyprint\">Sub Select1()\r\n    For i = 1 To 54\r\n   \r\n        Dim sName1 As String\r\n        Dim sName2 As String\r\n        \r\n        sName1 = Trim(Sheet1.Cells(i, 2))\r\n        \r\n        For j = 1 To 96            \r\n            sName2 = Trim(Sheet2.Cells(j, 1))\r\n            '\/\/Debug.Print sName1, sName2\r\n            If ((sName1 = sName2) And (sName1 = sName2)) Then\r\n               Sheet1.Cells(i, 3) = IIf(Sheet2.Cells(j, 2) &gt; 0, Sheet2.Cells(j, 2), \"\")\r\n               Sheet1.Cells(i, 4) = Sheet2.Cells(j, 3)\r\n               Sheet1.Cells(i, 5) = IIf(Sheet2.Cells(j, 4) &gt; 0, Sheet2.Cells(j, 4), \"\")\r\n               Sheet1.Cells(i, 6) = Sheet2.Cells(j, 5)\r\n             Exit For\r\n            End If\r\n        Next j\r\n    \r\n    Next i\r\nEnd Sub<\/pre>\n<p><a href=\"https:\/\/auctionpro.co.kr\/wp-content\/uploads\/2017\/01\/vba01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4681\" src=\"https:\/\/auctionpro.co.kr\/wp-content\/uploads\/2017\/01\/vba01.png\" alt=\"\" width=\"250\" height=\"374\" srcset=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2017\/01\/vba01.png 250w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2017\/01\/vba01-201x300.png 201w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2017\/01\/vba01-100x150.png 100w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<pre class=\"prettyprint\">\r\nSub Select1()\r\nDim price  As Integer\r\n \r\n    For i = 1 To 13\r\n   \r\n        Dim sName1 As String\r\n        Dim sName2 As String\r\n        \r\n        sName1 = Trim(Sheet1.Cells(i, 1))\r\n        sName2 = Trim(Sheet1.Cells(i, 2))\r\n        \r\n        price = 0 '\/\/\ucd08\uae30\uac12\r\n        If (Trim(sName1) = \"\uae30\ud0c0\" And Trim(sName2) = \"\ubb38\uc7902\") Then\r\n          price = Sheet1.Cells(i, 3) + price\r\n          Sheet1.Cells(15, 1) = price\r\n        End If\r\n        \r\n     Next i\r\n    \r\nEnd Sub\r\n\r\n\r\n<\/pre>\n<p>\uc0d8\ud50c 3<\/p>\n<p><a href=\"https:\/\/auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/excel02.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/excel02.png\" alt=\"\" width=\"750\" height=\"663\" class=\"alignnone size-full wp-image-4685\" srcset=\"https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/excel02.png 750w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/excel02-300x265.png 300w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/excel02-150x133.png 150w, https:\/\/www.auctionpro.co.kr\/wp-content\/uploads\/2016\/11\/excel02-400x354.png 400w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/a><\/p>\n<pre class=\"prettyprint\">\r\nSub Select1()\r\n    \r\n    For i = 2 To 29\r\n   \r\n        Dim s1 As Integer\r\n        \r\n        Dim s2 As Integer\r\n                \r\n        s1 = Trim(Sheet1.Cells(i, 1))\r\n        \r\n        For j = 2 To 4\r\n        \r\n            s2 = Trim(Sheet1.Cells(i, j))\r\n            \r\n            If (s1 <= s2) Then\r\n             s1 = s2\r\n             \r\n             Sheet1.Cells(i, 6 + j) = s2\r\n             \r\n            End If\r\n            \r\n        'Debug.Print s2\r\n        \r\n        Next j\r\n        \r\n        Sheet1.Cells(i, 6) = s1\r\n        \r\n        'Debug.Print s1\r\n        \r\n    Next i\r\nEnd Sub\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>vb \ubc30\uc6b4\uac70 \uc368\uba39\uc744 \ub54c\uac00 \ub9ce\ub124\uc694. Sub Select1() For i = 1 To 54 Dim sName1 As String Dim sName2 As String sName1 = Trim(Sheet1.Cells(i, 2)) <a class=\"mh-excerpt-more\" href=\"https:\/\/www.auctionpro.co.kr\/?p=4653\" title=\"Excel VBA  \ud65c\uc6a9\ud558\uae30\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[14],"tags":[],"class_list":["post-4653","post","type-post","status-publish","format-standard","hentry","category-visualbasic6-0-vb"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/4653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4653"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/4653\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}