Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
debug help
Dim rng as Range
Sheets("Sheet1").Select Range("B9:H117").Select On Error Resume Next set rng = Selection.SpecialCells(xlCellTypeBlanks) On Error goto 0 if not rng is nothing then Selection.Value = "n/a" Selection.Font.ColorIndex = 0 End if Range("J20").Select Sheets("start").Select or Dim rng as Range On Error resume next set rng = Worksheets("Sheet1").Range("B9:H117"). _ specialCells(xlCellTypeBlanks) On Error goto 0 if not rng is nothing then rng.Value = "n/a" rng.Font.ColorIndex = 0 End if -- Regards, Tom Ogilvy "Jo" wrote in message ... Hi The following code works fine if the blank cells are present, however it fails if they are not. How do I make this more robust? Thanks Jo Sheets("Sheet1").Select Range("B9:H117").Select Selection.SpecialCells(xlCellTypeBlanks).Select Selection.Value = "n/a" Selection.Font.ColorIndex = 0 Range("J20").Select Sheets("start").Select |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Debug on userform | Excel Discussion (Misc queries) | |||
VB Debug Reset | Excel Discussion (Misc queries) | |||
debug code | Excel Discussion (Misc queries) | |||
DeBug | Excel Discussion (Misc queries) | |||
help with debug | New Users to Excel |