Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default remove little green error triangle - how loop through to ignore er

I have hundreds of cells with formulas, and several of them have the little
green triangle because they reference another cell that is empty. I want to
ignore this/these errors. If I set up a range object in VBA, I can loop
through all the range areas and loop through all the respective cells. But
what object do I need to reference in order to set a cell property to ignore
the error?

--here is some pseudocode - does Excel have an xlError type ? I don't get
intellisense from my range object here.

Dim rng As range
Set rng = Sheet1.Range("A1:E5, A8:E13, A16:E21")
For i = 1 To rng.Areas.Count
For j = 1 To rng.Areas(i).Columns.Count
For k = 1 To rng.Areas(i).Rows.Count
rng.Areas(i)(k,j).Error = xlError.Ignore
,,,

Thanks,
Rich
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default remove little green error triangle - how loop through to ignore er

Is the only thing you want to do is remove the green error triangle when a
formula refers to a blank cell? Or is there more to your request. If all you
want to do is remove the green triangle, and nothing else with respect to
it, then click Tools/Options on Excel's menu bar, select the "Error
Checking" tab and uncheck the Rules item labeled "Formulas referring to
empty cells".

Rick


"Rich" wrote in message
...
I have hundreds of cells with formulas, and several of them have the little
green triangle because they reference another cell that is empty. I want
to
ignore this/these errors. If I set up a range object in VBA, I can loop
through all the range areas and loop through all the respective cells.
But
what object do I need to reference in order to set a cell property to
ignore
the error?

--here is some pseudocode - does Excel have an xlError type ? I don't get
intellisense from my range object here.

Dim rng As range
Set rng = Sheet1.Range("A1:E5, A8:E13, A16:E21")
For i = 1 To rng.Areas.Count
For j = 1 To rng.Areas(i).Columns.Count
For k = 1 To rng.Areas(i).Rows.Count
rng.Areas(i)(k,j).Error = xlError.Ignore
,,,

Thanks,
Rich


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default remove little green error triangle - how loop through to ignore er

One way:

Dim rFormulas As Range
Dim rCell As Range
On Error Resume Next
Set rFormulas = Sheet1.Range("A1:E5,A8:E13,A16:E21").SpecialCells( _
xlCellTypeFormulas)
On Error GoTo 0
If Not rFormulas Is Nothing Then
For Each rCell In rFormulas
rCell.Errors.Item(xlEmptyCellReferences).Ignore = True
Next rCell
End If




In article ,
Rich wrote:

I have hundreds of cells with formulas, and several of them have the little
green triangle because they reference another cell that is empty. I want to
ignore this/these errors. If I set up a range object in VBA, I can loop
through all the range areas and loop through all the respective cells. But
what object do I need to reference in order to set a cell property to ignore
the error?

--here is some pseudocode - does Excel have an xlError type ? I don't get
intellisense from my range object here.

Dim rng As range
Set rng = Sheet1.Range("A1:E5, A8:E13, A16:E21")
For i = 1 To rng.Areas.Count
For j = 1 To rng.Areas(i).Columns.Count
For k = 1 To rng.Areas(i).Rows.Count
rng.Areas(i)(k,j).Error = xlError.Ignore
,,,

Thanks,
Rich

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default remove little green error triangle - how loop through to ignore er

Thank you all for your responses. I will be emailing the sheet in question
to other people who may not have checked off the Option for error checking.
So I need to do this in VBA. JE has a solution. Thanks.

question: If I run this loop for all cells, including cells that don't have
a green triangle, will this impair anything? I will guess not.

"Rich" wrote:

I have hundreds of cells with formulas, and several of them have the little
green triangle because they reference another cell that is empty. I want to
ignore this/these errors. If I set up a range object in VBA, I can loop
through all the range areas and loop through all the respective cells. But
what object do I need to reference in order to set a cell property to ignore
the error?

--here is some pseudocode - does Excel have an xlError type ? I don't get
intellisense from my range object here.

Dim rng As range
Set rng = Sheet1.Range("A1:E5, A8:E13, A16:E21")
For i = 1 To rng.Areas.Count
For j = 1 To rng.Areas(i).Columns.Count
For k = 1 To rng.Areas(i).Rows.Count
rng.Areas(i)(k,j).Error = xlError.Ignore
,,,

Thanks,
Rich

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default remove little green error triangle - how loop through to ignore er

this may work for you, too. just pick a blank cell, i chose M1.

it will only affect constants

Option Explicit
Sub test()
Dim ws As Worksheet
Set ws = Worksheets("sheet1")
With ws
.Range("M1").Copy
.UsedRange.SpecialCells(xlConstants).PasteSpecial Paste:=xlPasteAll, _
Operation:=xlAdd, SkipBlanks:=False, Transpose:=False
End With
End Sub

--


Gary


"Rich" wrote in message
...
Thank you all for your responses. I will be emailing the sheet in question
to other people who may not have checked off the Option for error checking.
So I need to do this in VBA. JE has a solution. Thanks.

question: If I run this loop for all cells, including cells that don't have
a green triangle, will this impair anything? I will guess not.

"Rich" wrote:

I have hundreds of cells with formulas, and several of them have the little
green triangle because they reference another cell that is empty. I want to
ignore this/these errors. If I set up a range object in VBA, I can loop
through all the range areas and loop through all the respective cells. But
what object do I need to reference in order to set a cell property to ignore
the error?

--here is some pseudocode - does Excel have an xlError type ? I don't get
intellisense from my range object here.

Dim rng As range
Set rng = Sheet1.Range("A1:E5, A8:E13, A16:E21")
For i = 1 To rng.Areas.Count
For j = 1 To rng.Areas(i).Columns.Count
For k = 1 To rng.Areas(i).Rows.Count
rng.Areas(i)(k,j).Error = xlError.Ignore
,,,

Thanks,
Rich



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
removing green triangle in cell Shooter Excel Worksheet Functions 4 May 7th 23 11:45 AM
How do I eliminate the green triangle throughout my spreadsheet? Patrick Traynor Excel Discussion (Misc queries) 5 April 5th 23 01:10 PM
Force Green triangle to appear FIRSTROUNDKO via OfficeKB.com Excel Discussion (Misc queries) 2 December 4th 09 03:02 PM
What is the little green triangle??? mscertified Excel Worksheet Functions 1 September 19th 07 06:39 PM
Green Triangle in Cell M. B. Collins Excel Discussion (Misc queries) 4 August 8th 06 01:46 AM


All times are GMT +1. The time now is 03:42 PM.

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"