#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Debug on userform Jase Excel Discussion (Misc queries) 1 May 28th 08 05:00 PM
VB Debug Reset SJW_OST Excel Discussion (Misc queries) 1 February 7th 08 03:07 AM
debug code mohavv Excel Discussion (Misc queries) 1 November 27th 07 09:56 PM
DeBug Ollie Excel Discussion (Misc queries) 4 April 28th 06 03:17 PM
help with debug Rusty New Users to Excel 3 February 2nd 05 03:16 AM


All times are GMT +1. The time now is 10:59 PM.

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"