Mathmatical operators in VBA code
- From: "Steve via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxx>
- Date: Fri, 05 Aug 2005 18:26:30 GMT
I copied the following formula from a proc I had that checked for positive
values in a range with some numeric values and deletes the entire row if not
positive numeric value - this I want to work similarly if the value is NOT
101 - I first had it backwards, and it deleted all rows that HAD 101 in the
range - exactly the opposite what I wanted it to do - I figured "Easy just
change the operator from '=' to ' < > ' - but it went into a loop here is
code:
------------------------------------------------------------------------------
--
For Each mvt In Range("Mvt") If mvt.Value = 101 Then
If rangeToSelect Is Nothing Then
Set rangeToSelect = mvt.EntireRow
Else Set rangeToSelect = Union(rangeToSelect, mvt.EntireRow)
End If End If Next If rangeToSelect Is Nothing Then MsgBox
"Handle mvt 101" 'Show message Else:
rangeToSelect.Delete Set rangeToSelect = Nothing End If
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-toolkits/200508/1
.
- Prev by Date: Undocumented error code and Validation Rule problems
- Next by Date: Mathmatical operators in VBA code
- Previous by thread: Undocumented error code and Validation Rule problems
- Next by thread: Mathmatical operators in VBA code
- Index(es):
Relevant Pages
|