<?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>Excel Zoom &#187; Hidden</title>
	<atom:link href="http://excelzoom.com/tag/hidden/feed/" rel="self" type="application/rss+xml" />
	<link>http://excelzoom.com</link>
	<description>...because it&#039;s more than just a calculator</description>
	<lastBuildDate>Wed, 02 Sep 2009 20:43:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Hide/Unhide Columns</title>
		<link>http://excelzoom.com/2009/04/hideunhide-columns/</link>
		<comments>http://excelzoom.com/2009/04/hideunhide-columns/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 13:18:11 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Macros]]></category>
		<category><![CDATA[Formats]]></category>
		<category><![CDATA[Hidden]]></category>

		<guid isPermaLink="false">http://excelzoom.com/?p=54</guid>
		<description><![CDATA[On occasion, you might find yourself creating a spreadsheet that has multiple columns all set up in a consistent format (i.e. quarterly sales figures for the past 5 years). As time goes on, you may add/remove data to the spreadsheet as needed. This may result in some columns not being used (i.e. in April only [...]]]></description>
			<content:encoded><![CDATA[<p>On occasion, you might find yourself creating a spreadsheet that has multiple columns all set up in a consistent format (i.e. quarterly sales figures for the past 5 years).  As time goes on, you may add/remove data to the spreadsheet as needed.  This may result in some columns not being used (i.e. in April only the first quarter&#8217;s information will be filled out for the current year, leaving the second, third and fourth quarters blank).</p>
<p><img src="http://excelzoom.com/images/hide_columns_example.jpg" alt="Excel Hide Column Macro" width="500" height="127" /></p>
<p>Using the quarterly sales example above, assume that you&#8217;ve taken the time to set up your spreadsheet with placeholder columns for the remainder of the year.  When printing the information, you don&#8217;t want to just delete the columns, only having to recreate them in the future, and you also don&#8217;t want to have to manually hide/unhide them either.</p>
<p>You can use a macro to toggle between hiding and unhiding these empty columns fairly easily.  The first bit of code will determine if the total in row 8 for columns B through M is 0.  If it is, it will hide the column, otherwise it will make sure the column is not hidden.  The second bit of code will select columns B through M and make sure they all are not hidden, so that you can toggle between hiding the unused columns, and showing all the columns.</p>
<p>To use this in your own spreadsheet, you may need to change a few things. 1) Change the Range reference (i.e. &#8220;B8:M8&#8243;) to whatever range you want evaluated. 2) Change &#8220;Columns&#8221; in Rng = Selection.Columns.Count to &#8220;Rows&#8221; if the range you are evaluating is a range of rows not columns. 3) If the criteria is something other than &#8220;0&#8243;, change the &#8220;0&#8243;  in If ActiveCell = 0 to whatever that criteria happens to be.  And finally 4) the two lines that say ActiveCell.Offset(0, 1).Select simply moves the selected cell down 0 cells and to the right one cell.  If you&#8217;re evaluating down a range of rows, change the 0 to a 1 and the 1 to a 0 so that it moves the selected cell down 1 cell and to the right 0 cells.  (Note you can move up a cell by inserting a -1 as the first number and to the left by inserting a -1 as the second number).</p>
<p>Need help? Use our <a href="http://excelzoom.com/?p=7">nifty guide</a> to help figure out how to install and use your macros.</p>
<p><strong>Hide Unused Columns:</strong><br />
<code><br />
Sub hide_unused()<br />
'<br />
'MACROS BY EXCELZOOM.COM<br />
'<br />
Application.ScreenUpdating = False<br />
Range("B8:M8").Select<br />
Rng = Selection.Columns.Count<br />
For i = 1 To Rng<br />
If ActiveCell = 0 Then<br />
Selection.EntireColumn.Hidden = True<br />
ActiveCell.Offset(0, 1).Select<br />
Else: Selection.EntireColumn.Hidden = False<br />
ActiveCell.Offset(0, 1).Select<br />
End If<br />
Next i<br />
Application.ScreenUpdating = True<br />
End Sub</code><br />
<strong>Unhide all Columns:</strong><br />
<code><br />
Sub unhide_all()<br />
'<br />
'MACROS BY EXCELZOOM.COM<br />
'<br />
Application.ScreenUpdating = False<br />
Columns("B:M").Select<br />
Selection.EntireColumn.Hidden = False<br />
Application.ScreenUpdating = True<br />
End Sub<br />
</code></p>
<!-- Easy AdSense V2.61 -->
<!-- Post[count: 2] -->
<div class="ezAdsense adsense adsense-leadout" style="float:left;margin:12px;"><script type="text/javascript"><!--
google_ad_client = "pub-0662082843230645";
/* Excel Zoom Post Bottom468x60, created 5/31/09 */
google_ad_slot = "1891900730";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://excelzoom.com/2009/04/hideunhide-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delete Hidden Rows and Columns</title>
		<link>http://excelzoom.com/2009/02/45/</link>
		<comments>http://excelzoom.com/2009/02/45/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 14:44:28 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Macros]]></category>
		<category><![CDATA[Delete]]></category>
		<category><![CDATA[Hidden]]></category>

		<guid isPermaLink="false">http://excelzoom.com/?p=45</guid>
		<description><![CDATA[Sometimes we hide certain rows or columns because we don&#8217;t want the data to print, or just to get it out of the way. Other times though we simply don&#8217;t want to share the data in a hidden row or column. Assuming that the data in visible cells isn&#8217;t dependent on the data in hidden [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we hide certain rows or columns because we don&#8217;t want the data to print, or just to get it out of the way. Other times though we simply don&#8217;t want to share the data in a hidden row or column. Assuming that the data in visible cells isn&#8217;t dependent on the data in hidden cells (i.e. if a formula references a hidden cell), we can use the macro below to automatically delete any hidden rows and columns in the active worksheet.</p>
<p>If you only want the hidden rows to be deleted, remove the three lines starting with For Ip = 256 through Next. To only delete the hidden columns, remove the next three lines starting with For lp = 65536 through Next.</p>
<p>Copy all of the code below. Paste it into your workbook&#8217;s Visual Basic editor, either under a Microsoft Excel Object or Module.</p>
<p>Need help? Use our <a href="http://excelzoom.com/?p=7">nifty guide</a> to help figure out how to install and use your macros.<br />
<code><br />
Sub DeleteHiddenRowsColumns()<br />
'<br />
'MACROS BY EXCELZOOM.COM<br />
'<br />
Application.ScreenUpdating = False<br />
For lp = 256 To 1 Step -1<br />
If Columns(lp).EntireColumn.Hidden = True Then Columns(lp).EntireColumn.Delete Else<br />
Next</code></p>
<p> </p>
<p><code>For lp = 65536 To 1 Step -1<br />
If Rows(lp).EntireRow.Hidden = True Then Rows(lp).EntireRow.Delete Else<br />
Next<br />
Application.ScreenUpdating = True<br />
End Sub</code></p>
]]></content:encoded>
			<wfw:commentRss>http://excelzoom.com/2009/02/45/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
