<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://isom.uoregon.edu/community/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Duck Bytes : Microsoft Excel</title><link>http://isom.uoregon.edu/community/blogs/castner/archive/tags/Microsoft+Excel/default.aspx</link><description>Tags: Microsoft Excel</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>Generating random question numbers for surveys or exams</title><link>http://isom.uoregon.edu/community/blogs/castner/archive/2007/03/02/Generating-random-question-numbers-for-surveys-or-exams.aspx</link><pubDate>Fri, 02 Mar 2007 23:37:00 GMT</pubDate><guid isPermaLink="false">4ac6e2ff-a44c-42df-b503-9719f53eb121:687</guid><dc:creator>gcastner</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://isom.uoregon.edu/community/blogs/castner/rsscomments.aspx?PostID=687</wfw:commentRss><comments>http://isom.uoregon.edu/community/blogs/castner/archive/2007/03/02/Generating-random-question-numbers-for-surveys-or-exams.aspx#comments</comments><description>&lt;p&gt;I was recently asked to create a random question number generator in Microsoft Excel. The requirements were to create random question numbers from 1 to 65 that did not repeat. Here is the solution I came up with but I would interested to hear of any better methods:&lt;/p&gt;&lt;p&gt;Sub GenerateQuestions()&lt;/p&gt;&lt;p&gt;&amp;#39; Use Column B to display the random question numbers&lt;br /&gt;Range(&amp;quot;B1&amp;quot;).Select&lt;/p&gt;&lt;p&gt;&amp;#39;Number of questions&lt;br /&gt;questionCount = 65&lt;br /&gt;For counter = 1 To questionCount&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Generate random number&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveCell.FormulaR1C1 = &amp;quot;=RANDBETWEEN(1,65)&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; questionsAllocated = counter - 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Check if question number already allocated&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For checkCounter = 1 To questionsAllocated&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ActiveCell.Value = ActiveCell.Offset(-checkCounter, 0).Value Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveCell.Value = ActiveCell.Value + 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ActiveCell.Value = questionCount + 1 Then ActiveCell.Value = 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; checkCounter = 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next checkCounter&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;#39; Copy and Paste Values so that allocated question numbers don&amp;#39;t regenerate&lt;br /&gt;Selection.Copy&lt;br /&gt;Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; :=False, Transpose:=False&lt;/p&gt;&lt;p&gt;&amp;#39; Go to next question&lt;br /&gt;ActiveCell.Offset(1, 0).Select&lt;br /&gt;Next counter &amp;#39;Loop&lt;/p&gt;&lt;p&gt;End Sub&lt;/p&gt;&lt;img src="http://isom.uoregon.edu/community/aggbug.aspx?PostID=687" width="1" height="1"&gt;</description><category domain="http://isom.uoregon.edu/community/blogs/castner/archive/tags/LCB+Computing/default.aspx">LCB Computing</category><category domain="http://isom.uoregon.edu/community/blogs/castner/archive/tags/Microsoft+Excel/default.aspx">Microsoft Excel</category></item><item><title>Text manipulation in Microsoft Excel</title><link>http://isom.uoregon.edu/community/blogs/castner/archive/2007/02/11/Text-manipulation-in-Microsoft-Excel-2.aspx</link><pubDate>Sun, 11 Feb 2007 20:48:00 GMT</pubDate><guid isPermaLink="false">4ac6e2ff-a44c-42df-b503-9719f53eb121:473</guid><dc:creator>gcastner</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://isom.uoregon.edu/community/blogs/castner/rsscomments.aspx?PostID=473</wfw:commentRss><comments>http://isom.uoregon.edu/community/blogs/castner/archive/2007/02/11/Text-manipulation-in-Microsoft-Excel-2.aspx#comments</comments><description>&lt;div class="ForumPostContentText" id="ctl00_ctl01_bcr_SinglePostView___PostViewWrapper"&gt;&lt;p&gt;Here are a number of simple but useful functions&amp;nbsp;for manipulating text in Microsoft Excel. One potential use of these functions is to separate last and first name when they are stored in a single cell. An example Excel file is also attached.&lt;/p&gt;&lt;p&gt;This formula will return the first five characters from the left in cell A2:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;=LEFT(A2,5)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;This formula will return the total number of characters (including spaces) in cell A2:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;=LEN(A2)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;This formula will return the number of characters (including spaces) from the left until the first space in cell A2:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;=FIND(&amp;quot; &amp;quot;,A2)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To find first names where first name and last name are separated by a space:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;=LEFT(A2,FIND(&amp;quot; &amp;quot;,A2)-1)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To find last Names where first name and last name are separated by a space:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;=RIGHT(A2,LEN(A2)-FIND(&amp;quot; &amp;quot;,A2))&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;&lt;img height="1" src="http://community.oregonebiz.com/aggbug.aspx?PostID=999" width="1" alt="" /&gt;&lt;img src="http://isom.uoregon.edu/community/aggbug.aspx?PostID=473" width="1" height="1"&gt;</description><category domain="http://isom.uoregon.edu/community/blogs/castner/archive/tags/LCB+Computing/default.aspx">LCB Computing</category><category domain="http://isom.uoregon.edu/community/blogs/castner/archive/tags/Microsoft+Excel/default.aspx">Microsoft Excel</category></item></channel></rss>