Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default How do I build "hide a row" into a macro if #N/A appears in a colu

I have several large workbooks in Excel with up to 28 sheets. I use a
VLOOKUP to enter pricing in the sheets, some 10,000. I have 50 offices with
different product availability factors. If the product is unavailable a #N/A
appears. I then go in and hide the row or rows where #N/A appears in the
pricing column. There could be up to 150 rows that need to be manually
hidden per sheet. Can this search and hide function be accomplished by
building a macro which would search the entire workbook or even a single
sheet to hide the rows which reflect the #N/A in a specific column
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How do I build "hide a row" into a macro if #N/A appears in a colu

select the pricing column do
Edit=Goto =Special Cells

Select formulas and Errors
then Click OK.

No do Format=Rows=Hide

in code

Sub HideRows()
Dim sh as Worksheet
Dim rng as Range
for each sh in Worksheets
sh.Rows.Hidden = False
On error resume next
set rng = sh.Columns(3).SpecialCells(xlFormulas,xlErrors)
On error goto 0
if not rng is nothing then
rng.EntireRow.Hidden = True
end if
Next
end sub



change the 3 in Columns(3) to reflect the pricing column.
--
Regards,
Tom Ogilvy

"Dick" wrote:

I have several large workbooks in Excel with up to 28 sheets. I use a
VLOOKUP to enter pricing in the sheets, some 10,000. I have 50 offices with
different product availability factors. If the product is unavailable a #N/A
appears. I then go in and hide the row or rows where #N/A appears in the
pricing column. There could be up to 150 rows that need to be manually
hidden per sheet. Can this search and hide function be accomplished by
building a macro which would search the entire workbook or even a single
sheet to hide the rows which reflect the #N/A in a specific column

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default How do I build "hide a row" into a macro if #N/A appears in a colu

How about autofilter? Select Custom, Does Not Contain = #N/A

Charles
Dick wrote:
I have several large workbooks in Excel with up to 28 sheets. I use a
VLOOKUP to enter pricing in the sheets, some 10,000. I have 50 offices with
different product availability factors. If the product is unavailable a #N/A
appears. I then go in and hide the row or rows where #N/A appears in the
pricing column. There could be up to 150 rows that need to be manually
hidden per sheet. Can this search and hide function be accomplished by
building a macro which would search the entire workbook or even a single
sheet to hide the rows which reflect the #N/A in a specific column


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format a cell such that "#NAME?" reads/appears "N/A"? Fred Holmes Excel Discussion (Misc queries) 3 June 18th 09 06:32 AM
Changing the incrementation when "puliing" cell values down a colu Matt G[_2_] Excel Worksheet Functions 5 November 4th 08 01:15 PM
Chg 1 "Last, First Mid" column to 3 "First", "Middle", "Last" colu JBird11002 Excel Discussion (Misc queries) 4 August 15th 08 06:31 PM
How can I change "." to "," so e.g. 1.000 = 1,000 in the same colu Tracy Excel Discussion (Misc queries) 2 April 11th 06 12:55 PM
How do you hide macro names from showing in "Tools"? Nashua Excel Programming 1 November 9th 05 03:50 PM


All times are GMT +1. The time now is 06:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"