LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Catching errors


So i've filled a column with "=G2*VLOOKUP(D2,Units,2,FALSE)"
Sometimes that's going to fail and the value of the cell will be
#VALUE!.
So then i've got a loop to go through and clear any 0s. However, the
problem occurs when it hits one of the cells that didn't calcuate
right. I want to clear that cell's value, but i wasn't sure how to
catch it.

Do While Not IsEmpty(ActiveCell.Offset(0))

If ActiveCell.Value = 0 Then
ActiveCell.Value = ""
Else: ActiveCell.Value = 1
End If

ActiveCell.Offset(1).Select
Loop


Thanks,

Chris


--
cbh35711
------------------------------------------------------------------------
cbh35711's Profile: http://www.excelforum.com/member.php...o&userid=30276
View this thread: http://www.excelforum.com/showthread...hreadid=529383

 
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
catching cancel on QueryTable.Refresh tysop Excel Programming 0 February 16th 06 12:48 PM
globally catching any error event? RB Smissaert Excel Programming 2 August 4th 05 07:16 PM
Catching VbMsgBoxResult jose luis Excel Programming 2 October 31st 04 06:43 AM
Catching NewSheet-Event in another WorkBook Christoph Basedau Excel Programming 3 October 8th 04 12:01 PM
Catching an error Shannon Excel Programming 1 December 8th 03 08:22 PM


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

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

About Us

"It's about Microsoft Excel"