<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nandeshwar.info &#187; cells</title>
	<atom:link href="http://nandeshwar.info/tag/cells/feed/" rel="self" type="application/rss+xml" />
	<link>http://nandeshwar.info</link>
	<description></description>
	<lastBuildDate>Wed, 18 Aug 2010 19:24:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flip row or column</title>
		<link>http://nandeshwar.info/2005/03/30/flip-row-or-column/</link>
		<comments>http://nandeshwar.info/2005/03/30/flip-row-or-column/#comments</comments>
		<pubDate>Wed, 30 Mar 2005 21:19:00 +0000</pubDate>
		<dc:creator>a7n9</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cells]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[flip]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://a7n9.wordpress.com/2005/03/30/flip-row-or-column/</guid>
		<description><![CDATA[To flip the given row as shown in this figure, use the following macro

Result row

You can use the same macro for flipping columns too, code will find if it&#8217;s a row or a column.
Note: This code was modified on 07/26/07 for error checking, and removal of Option Base
Sub flip()
Dim Arr As Variant
Dim myrange As Range
Dim [...]]]></description>
			<content:encoded><![CDATA[<p>To flip the given row as shown in this figure, use the following macro</p>
<div class="flickrEmailPost"><a title="Flip row or column" href="http://www.flickr.com/photos/78033189@N00/7917811/"><img class="flickrEmailImage" src="http://photos6.flickr.com/7917811_06ff0e5046.jpg" alt="Flip row or column" /></a></div>
<p>Result row</p>
<div class="flickrEmailPost"><a title="Flip row or column" href="http://www.flickr.com/photos/78033189@N00/7917800/"><img class="flickrEmailImage" src="http://photos7.flickr.com/7917800_c795b8c13e.jpg" alt="Flip row or column" /></a></div>
<p>You can use the same macro for flipping columns too, code will find if it&#8217;s a row or a column.</p>
<p><span style="font-style:italic;">Note: This code was modified on 07/26/07 for error checking, and removal of Option Base</span></p>
<div id="code"><span style="font-family: Courier;"><span style="color:#00007F;">Sub</span> flip()</span></p>
<p><span style="color:#00007F;"><span style="font-family: Courier;">Dim</span></span><span style="font-family: Courier;"> Arr <span style="color:#00007F;">As</span> <span style="color:#00007F;">Variant</span><br />
<span style="color:#00007F;">Dim</span> myrange <span style="color:#00007F;">As</span> Range<br />
<span style="color:#00007F;">Dim</span> vSplitedArr <span style="color:#00007F;">As</span> <span style="color:#00007F;">Variant</span><br />
<span style="color:#00007F;">Dim</span> arRetArr() <span style="color:#00007F;">As</span> <span style="color:#00007F;">Variant</span>, lArrBnd <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span>, i <span style="color:#00007F;">As</span> <span style="color:#00007F;">Long</span></span></p>
<p><span style="color:#00007F;"><span style="font-family: Courier;">On</span></span><span style="font-family: Courier;"> <span style="color:#00007F;">Error</span> <span style="color:#00007F;">GoTo</span> flip_Error</span></p>
<p><span style="color:#00007F;"><span style="font-family: Courier;">Set</span></span><span style="font-family: Courier;"> myrange = Range(Selection.Address)<br />
Arr = myrange <span style="color:#007F00;">&#8217;store the selected values in an array</span></span></p>
<p><span style="color:#007F00;"><span style="font-family: Courier;">&#8217;split the selected cells address to an array</span></span><span style="font-family: Courier;"><br />
vSplitedArr = Split(Selection.Address, &#8220;$&#8221;)</span></p>
<p><span style="color:#007F00;"><span style="font-family: Courier;">&#8216; check if Column names are same</span></span><span style="font-family: Courier;"><br />
<span style="color:#00007F;">If</span> vSplitedArr(1) = vSplitedArr(3) <span style="color:#00007F;">Then</span><br />
lArrBnd = <span style="color:#00007F;">UBound</span>(Arr, 1)<br />
<span style="color:#00007F;">ReDim</span> arRetArr(lArrBnd, 0)<br />
<span style="color:#00007F;">For</span> i = 0 <span style="color:#00007F;">To</span> lArrBnd &#8211; 1<br />
<span style="color:#007F00;">&#8216;flip the array</span><br />
arRetArr(i, 0) = Arr(lArrBnd &#8211; i, 1)<br />
<span style="color:#00007F;">Next</span> i<br />
Range(Selection.Address) = arRetArr<br />
<span style="color:#007F00;">&#8216;check if Row numbers are same</span><br />
<span style="color:#00007F;">ElseIf</span> Replace(vSplitedArr(2), &#8220;:&#8221;, &#8220;&#8221;) = vSplitedArr(4) <span style="color:#00007F;">Then</span><br />
lArrBnd = <span style="color:#00007F;">UBound</span>(Arr, 2)<br />
<span style="color:#00007F;">ReDim</span> arRetArr(0, lArrBnd)<br />
<span style="color:#00007F;">For</span> i = 0 <span style="color:#00007F;">To</span> lArrBnd &#8211; 1<br />
<span style="color:#007F00;">&#8216;flip the array</span><br />
arRetArr(0, i) = Arr(1, lArrBnd &#8211; i)<br />
<span style="color:#00007F;">Next</span> i<br />
Range(Selection.Address) = arRetArr<br />
<span style="color:#00007F;">Else</span><br />
MsgBox &#8220;Your selection contains multiple rows or columns.&#8221; &amp; vbCrLf &amp; _<br />
&#8220;This macro will only work on either one column or one row&#8221;, vbCritical, &#8220;Flip Error&#8221;<br />
<span style="color:#00007F;">End</span> <span style="color:#00007F;">If</span></span></p>
<p><span style="color:#00007F;"><span style="font-family: Courier;">On</span></span><span style="font-family: Courier;"> Error <span style="color:#00007F;">GoTo</span> 0<br />
SmoothExit_flip:<br />
Exit <span style="color:#00007F;">Sub</span></span></p>
<p><span style="font-family: Courier;">flip_Error:<br />
MsgBox &#8220;Error &#8221; &amp; Err.Number &amp; &#8221; (&#8221; &amp; Err.Description &amp; &#8220;) in procedure flip&#8221;<br />
<span style="color:#00007F;">Resume</span> SmoothExit_flip<br />
<span style="color:#00007F;">End</span> <span style="color:#00007F;">Sub</span><br />
</span></div>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Share</div><div class='linkbuttons'><a href='http://www.citeulike.org/posturl?url=http://nandeshwar.info/2005/03/30/flip-row-or-column/&amp;title=Flip row or column' title='Save to CiteULike' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/citeulike.png' style='width:16px; height:16px;' alt='[CiteULike] ' /></a> <a href='http://del.icio.us/post?url=http://nandeshwar.info/2005/03/30/flip-row-or-column/&amp;title=Flip row or column' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://nandeshwar.info/2005/03/30/flip-row-or-column/&amp;title=Flip row or column' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://nandeshwar.info/2005/03/30/flip-row-or-column/' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.furl.net/storeIt.jsp?u=http://nandeshwar.info/2005/03/30/flip-row-or-column/&amp;t=Flip row or column' title='Save to Furl' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/furl.png' style='width:16px; height:16px;' alt='[Furl] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://nandeshwar.info/2005/03/30/flip-row-or-column/&amp;title=Flip row or column' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://nandeshwar.info/2005/03/30/flip-row-or-column/&amp;title=Flip row or column' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://nandeshwar.info/2005/03/30/flip-row-or-column/&amp;title=Flip row or column' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://nandeshwar.info/2005/03/30/flip-row-or-column/&amp;title=Flip row or column' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> <a href='http://technorati.com/faves?add=http://nandeshwar.info/2005/03/30/flip-row-or-column/' title='Add to my Technorati Favorites' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/technorati.png' style='width:16px; height:16px;' alt='[Technorati] ' /></a> <a href='http://twitter.com/home/?status=Flip row or column+http://nandeshwar.info/2005/03/30/flip-row-or-column/' title='Save to Twitter' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/twitter.png' style='width:16px; height:16px;' alt='[Twitter] ' /></a> <a href='http://www.feedburner.com/fb/a/emailFlare?itemTitle=Flip row or column&amp;uri=http://nandeshwar.info/2005/03/30/flip-row-or-column/&amp;loc=en_US' title='Email this to a friend' onclick='target="_blank";' rel='nofollow'><img src='http://nandeshwar.info/wp-content/plugins/bookmarkify/email.png' style='width:16px; height:16px;' alt='[Email] ' /></a>  <a title='See more bookmark and sharing options...' href='http://nandeshwar.info/2005/03/30/flip-row-or-column/#bookmarkify' rel='nofollow'><small>More&nbsp;&raquo;</small></a></div><div class='brand'><small><a href='http://www.bookmarkify.com/'>Powered by Bookmarkify&trade;</a></small></div></div>]]></content:encoded>
			<wfw:commentRss>http://nandeshwar.info/2005/03/30/flip-row-or-column/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
