Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with macro - deja vu
Somebody helped me build the short macro below which, I am pretty
sure, worked in an old file. I copied it into a new file and it is crashing on the 4th command. runtime error 1004 I have no recollection of what Selection.SpecialCells(xlCellTypeFormulas, 16).Select does! I have range-named a row "test.hide.column.by.DA" with some empty entries at the left and right but, in the middle, it has cells with either the number 1 or the text #N/A in them. My recollection is that it is supposed to hide every column that has the #N/A result in it. Can anyone help me figure out what is wrong. I don't see any cell comments. Sub hideColumns() Application.ScreenUpdating = False ActiveSheet.Unprotect Application.Goto Reference:="test.hide.column.by.DA" Selection.SpecialCells(xlCellTypeFormulas, 16).Select 'if the macro bombs at the line below, it may be due to cell comments!!, see 09-07-06 newsgroup post Selection.EntireColumn.Hidden = True 'this protects but allows column and row width changes ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _ , AllowFormattingCells:=True, AllowFormattingColumns:=True, _ AllowFormattingRows:=True Application.ScreenUpdating = True Range("a2").Select End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with macro - deja vu
Ok, I think I figured it out. It looks like it would need to be a
real #N/A, not just a text string. Never mind but thanks! D |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with macro - deja vu
You specifically looked through formulas by using: xlCellTypeFormulas xlcelltypeconstants would have been my next try. DA wrote: Ok, I think I figured it out. It looks like it would need to be a real #N/A, not just a text string. Never mind but thanks! D -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor | Excel Programming | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |