<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?lang=css&skin=sunburst"></script>各種のオプションの指定についてはダウンロードしたファイルの中のReadmeやサンプルを参考にしてください。
<script type="text/javascript" src="../JVS/prettify.js"></script> <link rel="stylesheet" href="../CSS/prettify.css" type="text/css">
<div class="prog_list"><pre class="prettyprint"> Option Explicit Public 読出行 As Long Public 書出行 As Long Public 金額 As Double Sub 同一現場売上集計() Dim RowMax As Long Dim 得意先コード As String Dim 担当者コード As Integer '最大行検出 <span class="highlight">RowMax = Cells(Rows.Count, 1).End(xlUp).Row</span> 書出行 = 2 金額 = 0 For 読出行 = 2 To RowMax 途中省略 Next 読出行 '不要行削除 <span class="highlight">Rows(CInt(書出行) & ":" & RowMax).Select Selection.Delete Shift:=xlUp</span> End Sub </pre></div>
/* Pretty printing styles. Used with prettify.js. */ /* SPAN elements with the classes below are added by prettyprint. */ .pln { color: #000 ; font-size : 12px; padding-bottom : 2px; } /* plain text */ @media screen { .str { color: #080 ;} /* string content */ .kwd { color: #008 ;} /* a keyword */ .com { color: #800 ;} /* a comment */ .typ { color: #606 ;} /* a type name */ .lit { color: #066 ;} /* a literal value */ /* punctuation, lisp open bracket, lisp close bracket */ .pun, .opn, .clo { color: #660 ;} .tag { color: #008 ;} /* a markup tag name */ .atn { color: #606 ;} /* a markup attribute name */ .atv { color: #080 ;} /* a markup attribute value */ .dec, .var { color: #606 ;} /* a declaration; a variable name */ .fun { color: red ;} /* a function name */ } /* Use higher contrast and text-weight for printable form. */ @media print, projection { .str { color: #060 ;} .kwd { color: #006; font-weight: bold ;} .com { color: #600; font-style: italic ;} .typ { color: #404; font-weight: bold ;} .lit { color: #044 ;} .pun, .opn, .clo { color: #440 ;} .tag { color: #006; font-weight: bold ;} .atn { color: #404 ;} .atv { color: #060 ;} } /* Put a border around prettyprinted code snippets. */ pre.prettyprint { padding-right: 2px; padding-left: 40px; color: black; font-family: "Courier New"; line-height: 20px; font-size: 15px; padding-bottom: 2px; } .highlight{ background-color: rgba(255, 255, 51, 0.5); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#80ffffA4,endColorstr=#80ffffA4); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#80ffffA4,endColorstr=#80ffffA4)"; width: 95%; } /* Specify class=linenums on a pre to get line numbering */ ol.linenums { margin-top: 0; margin-bottom: 0 ; } .prog_list{ border-width: 1px; border-style: solid; border-color: rgb(133, 133, 133); background-image : url(../images/whtgry_pad100040.gif); padding-top: 8px; width: 100%; }
Option Explicit Public 読出行 As Long Public 書出行 As Long Public 金額 As Double Sub 同一現場売上集計() Dim RowMax As Long Dim 得意先コード As String Dim 担当者コード As Integer '最大行検出 RowMax = Cells(Rows.Count, 1).End(xlUp).Row 書出行 = 2 金額 = 0 For 読出行 = 2 To RowMax 途中省略 Next 読出行 '不要行削除 Rows(CInt(書出行) & ":" & RowMax).Select Selection.Delete Shift:=xlUp End Sub