<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Issunのブログ</title>
<link>https://ameblo.jp/aevanko/</link>
<atom:link href="https://rssblog.ameba.jp/aevanko/rss20.xml" rel="self" type="application/rss+xml" />
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
<description>Localization, VBA, and C#</description>
<language>ja</language>
<item>
<title>CheckKanji Excel Function</title>
<description>
<![CDATA[ <p>Here is my kanji grade level checker written in VBA for Excel.</p><br><p>Link:</p><p><a href="http://www.aevanko.webs.com/checkkanji.txt">http://www.aevanko.webs.com/checkkanji.txt</a></p><br><p>How it works:</p><p>Say your cell is A1, then you'd write: =CheckKanji(A1) and by default it will check for any kanji outside of 6th grade. You can also specify the grade level. =CheckKanji(cell, 1) will check (and list up) any kanji outside of Grade 1 level.</p><br><p>I made the Kanji list STATIC meaning that it loads all of it into memory (not really heavy or anything) the first time it's run, and it stays there until Excel is closed. This makes the function run really really fast on all the cells in real-time. Some people prefer never to use the static keywork for variables in functions, but this is one case where it really really helps.</p>
]]>
</description>
<link>https://ameblo.jp/aevanko/entry-10974176693.html</link>
<pubDate>Wed, 03 Aug 2011 15:38:12 +0900</pubDate>
</item>
<item>
<title>Anyone there?</title>
<description>
<![CDATA[ Does anyone even read this blog? I was really hoping for feedback and even requests but so far this has been a one man affair. :(<br><br><br><br>iPhoneからの投稿
]]>
</description>
<link>https://ameblo.jp/aevanko/entry-10967341189.html</link>
<pubDate>Thu, 28 Jul 2011 00:26:31 +0900</pubDate>
</item>
<item>
<title>Working with ranges in excel</title>
<description>
<![CDATA[ In Excel, it's much faster to dump the values of a range of cells into a variable array and loop through each entry than have VBA access excel over and over again. Even faster if you do a quick conversion from variant array to single-dimensional string array!<img src="https://stat.ameba.jp/blog/ucs/img/char/char2/176.gif" alt="！！"><br><br><br><br>iPhoneからの投稿
]]>
</description>
<link>https://ameblo.jp/aevanko/entry-10961587219.html</link>
<pubDate>Fri, 22 Jul 2011 15:19:16 +0900</pubDate>
</item>
<item>
<title>VlookupLeft (Function)</title>
<description>
<![CDATA[ <p>Vlookup is a formula that will change the way you use Excel. It's only downfall is that you can only use it to return values in the rows to the right side of the cell that contains your search value.</p><br><p>Here is a simple function that will allow you to return values to the left of the search value. Just give the function the cell with the value you want to look for, then the column you want to look in (any sheet). As the final 3rd parameter, tell it how many rows forward or back it should go to find the return value. -1 is for the value to the left of the search column and 1 is for the row to the right, etc.</p><br><p>This is useful when the client updates a file and the order of the text is different and you need to copy paste everything you had done previously into the new file. Assuming the client is smart enough to use text IDs that don't change, run this. Give it the ID of the text then the column in the old file where it can look for it. Then if the ID is found, it will return the value found x rows to the right/left of the ID cell. Copy paste done in just a few seconds!</p><br><p>Vlookup is godly and fast, so only use this if you have to get the value in a row to the left of the search column (in those weird cases where the translation is in the column to the left of the original text or the column with the text ID).</p><br><p>------------------------------------------------------------</p><p>Function VLookupLeft(ByVal lookup_value, _<br>                     ByVal lookup_column As range, _<br>                     ByVal return_value_column As Long)</p><p>Application.ScreenUpdating = False<br>With Application<br>VLookupLeft = .Index(lookup_column.Offset(0, return_value_column), _<br>              .Match(lookup_value, lookup_column.Columns(1), 0), 1)<br>End With<br>Application.ScreenUpdating = True</p><p>End Function</p><p>------------------------------------------------------------</p>
]]>
</description>
<link>https://ameblo.jp/aevanko/entry-10956832500.html</link>
<pubDate>Sun, 17 Jul 2011 23:31:25 +0900</pubDate>
</item>
<item>
<title>CreateList (Function)</title>
<description>
<![CDATA[ <p>This is a useful function when you have several cells you want to combine to make a single cell. You can optionally specify a divider as well, so say you have:</p><p>A1: 15</p><p>A2: 20</p><p>A3: 25</p><br><p>You can combine them into one string, seperated by a comma by doing =CreateList(A1:A3, ", "). What you'll end up with is "15, 20, 25". The function will ignore all empty columns in the range of cells you give it, as well!</p><br><p>-------------------------------------------------</p><p>Function CreateList(ByVal cell_range As range, _<br>                    Optional ByVal seperator As String) As String</p><p>Application.ScreenUpdating = False<br>Dim cell As range<br>Dim newString As String<br>newString = vbNullString<br>Dim Counter As Integer<br>Counter = 0</p><p>For Each cell In cell_range<br>    Counter = Counter + 1<br>    newString = newString &amp; cell.Value<br>    If Counter &lt; cell_range.count Then ' If there is more to add<br>        If Len(cell.Value) &lt;&gt; 0 Then ' see if the cell is not empty<br>            newString = newString &amp; seperator<br>        End If<br>    End If<br>Next<br>    <br>CreateList = newString<br>Application.ScreenUpdating = True</p><p>End Function</p><p>-------------------------------------------------</p><br><br>
]]>
</description>
<link>https://ameblo.jp/aevanko/entry-10956813783.html</link>
<pubDate>Sun, 17 Jul 2011 23:21:36 +0900</pubDate>
</item>
<item>
<title>Find Term (Function for Translators)</title>
<description>
<![CDATA[ <p>The code below may be hard to read since the formatting is stripped away, but this is probobly my most useful function when it comes to translation.</p><br><p><u>What it does (in layman's terms):</u></p><p>Create a row and run this function down it. Tell it where the glossary is and it'll search your cells for every term in the glossary. It will give you back a list of all found terms, along with the translations. A perfect reference column to create before begining translation so you never have to look at the glossary while working!</p><br><p>There are 2 parameters: You pass the cell with the text, then the column that contains your glossary (can be a seperate sheet). It will look through the cell for each word in your glossary and at the end, the function returns a result string that will list all terms found, along with the translation in the row to the immediate right of the glossary term.</p><br><p>There are some sub routines on the web that will do a group search and replace in your text, but that is no-good in my book for several reasons. First, it's ugly. You shouldn't be replacing terms in the original text with their translations. Second, it changes the actual text so if something goes wrong, it's hard to spot. Third, sub-routines can't be undone, and that's not good.</p><br><p>This kind of a function makes it so you never have to open the glossary file and look for words - you just pre-process the file by making a REF column and running this function down it. Then paste special (copy, then right click and select paste special, then VALUE), then you are good to start translating. Since the original text isn't changing there is no need to keep the row as a formula after all.</p><br><p>With this in mind, to give it a speed boost, I made the glossary a static variable. This means that unless it is changed, the glossary will remain in memory for the entire time you have the file open. So just pre-process the file, and if you really care about memory, just save and reopen the file again. Static variables can be really useful in situations like this since there isn't a need to keep recreating the glossary array for each cell.</p><br><p><u>How it works (programmatically):</u></p><p>When you pass it the column (like A:A) that has the glossary terms, it will create a variable array that contains each entry in the list, and the entries in the row to the right. It then goes through all of them and uses Instr to check if the term is inside the cell or not. If it is, it adds it to a new string called result, along with "=" and the translated term, then a line break.</p><br><p><strong>Note</strong>: The glossary has to start on the first line of the column (so A1 if A:A) and there can't be any empty rows in the middle of the glossary. This is something I will create a work around for eventually, but I haven't yet. The reason is that in order to avoid empty strings being considered part of the glossary (in which case it would find in every cell of course), the glossary array is created by taking the first cell in the column and an entry is made for every consecutive term until it reaches a blank cell. Then it considers that to be the end of the glossary. The reason I choose to go with just specifying a column instead of a specific range is that when you copy the forumula down the file, A:A will remain A:A while something like A2:A100 will get incremented and that's a pain in the butt.</p><br><p>------------------------------------------------</p><p>Function FindTerm(ByVal text As String, ByVal term_list As range) As String</p><p>Application.ScreenUpdating = False<br>Dim result As String<br>Dim i As Long<br>Static glossary As Variant<br>glossary = range(term_list.cells(1, 1), term_list.cells(1, 2).End(xlDown))</p><p>For i = 1 To UBound(glossary)<br>If InStr(text, glossary(i, 1)) &lt;&gt; 0 Then<br>result = (glossary(i, 1) &amp; " = ") &amp; (glossary(i, 2) &amp; vbLf) &amp; result<br>End If<br>Next</p><p>If Len(result) &lt;&gt; 0 Then<br>result = Left$(result, (Len(result) - 1))<br>End If</p><p>FindTerm = result<br>Application.ScreenUpdating = True</p><p>End Function</p><p>------------------------------------------------</p>
]]>
</description>
<link>https://ameblo.jp/aevanko/entry-10956793802.html</link>
<pubDate>Sun, 17 Jul 2011 22:51:43 +0900</pubDate>
</item>
<item>
<title>RegexExtract V2.0</title>
<description>
<![CDATA[ <p>I tweaked my RegexExtract function so that it supports multiple capture groups. It'll return a string comprised of just the stuff you put in parenthesis. If anyone wants a version where you can specify a seperator (a string of characters that should go in between each match, like a comma), just let me know if the comments.</p><br><p>-----------------------------------------</p><p>Function RegexExtract(ByVal text As String, _<br>ByVal extract_what As String) As String</p><p>Application.ScreenUpdating = False<br>Dim allMatches As Object<br>Dim RE As Object<br>Set RE = CreateObject("vbscript.regexp")<br>Dim i As Long<br>Dim result As String</p><p>RE.Pattern = extract_what<br>RE.Global = True<br>Set allMatches = RE.Execute(text)</p><p>For i = 0 To allMatches.Item(0).submatches.count - 1<br>result = result &amp; allMatches.Item(0).submatches.Item(i)<br>Next</p><p>RegexExtract = result<br>Application.ScreenUpdating = True</p><p>End Function</p><p>-----------------------------------------</p>
]]>
</description>
<link>https://ameblo.jp/aevanko/entry-10955226190.html</link>
<pubDate>Sat, 16 Jul 2011 13:28:43 +0900</pubDate>
</item>
<item>
<title>Functions vs Sub Routines</title>
<description>
<![CDATA[ You'll notice that I won't generally post sub routines. Unlike functions, they allow you to alter properties of the worksheet but they also can't be undone and they alter the original text.<br><br>In translation and text manipulation, automation is risky work so by principle I write functions that will return the result I want, then I'll copy special by value and overwrite the original.<br><br>Functions are also great since you can write them so that they are flexible. IMO, you should never have to alter a function for each project.<br><br>Functions also rock since they can be used just like formulas in Excel. ^^<br><br><br>iPhoneからの投稿
]]>
</description>
<link>https://ameblo.jp/aevanko/entry-10955195848.html</link>
<pubDate>Sat, 16 Jul 2011 12:43:21 +0900</pubDate>
</item>
<item>
<title>Indenting Code</title>
<description>
<![CDATA[ Please note that Ameba destroys the indenting and formatting of code I post so it makes it harder to read. My apologies!<br><br>Remember that proper indentation is as important as properly naming your variables!<br><br>iPhoneからの投稿
]]>
</description>
<link>https://ameblo.jp/aevanko/entry-10955178875.html</link>
<pubDate>Sat, 16 Jul 2011 12:26:07 +0900</pubDate>
</item>
<item>
<title>Contains (Function)</title>
<description>
<![CDATA[ <p>This is a function that you can use to search if a cell contains specific text (it returns TRUE or FALSE). Cool thing is that you can pass multiple parameters to the function and it will act like OR. So you can write =Contains(A1, "yes", "no", "dog", "cat") and it will check if the cell contains ANY of the 4 words. If it does, it'll tell you TRUE.</p><br><br><br><p>This is helpful when you want to run a filter and work on just cells that contain certain words. Just run this function on all of the cells, then use filter to get everyone that ended up as TRUE.</p><br><br><br><p>-----------------------------------</p><br><p>Function Contains(ByVal text As String, _<br><br>                  ParamArray search_text() As Variant) As Boolean</p><br><p>Application.ScreenUpdating = False<br><br>Dim result As Boolean<br><br>result = False<br><br>Dim i As Long</p><br><p>For i = 0 To UBound(search_text())<br><br>    If InStr(1, text, search_text(i)) &lt;&gt; 0 Then<br><br>        result = True<br><br>    End If<br><br>Next</p><br><p>Contains = result<br><br>Application.ScreenUpdating = True</p><br><p>End Function</p><br><p>-----------------------------------</p>
]]>
</description>
<link>https://ameblo.jp/aevanko/entry-10954695470.html</link>
<pubDate>Fri, 15 Jul 2011 22:00:35 +0900</pubDate>
</item>
</channel>
</rss>
