Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default NEED ADDITION IN MACRO

Hi , I want to add line in macro below that if I have text of "ZERO
BUDGET"
appear in any cell of Range("K25:K62") then I should get
Message box appear that there is Zero budget.


Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
Const WS_RANGE As String = "B25:D62"
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If Me.Cells(.Row, "B").Value < "" And _
Me.Cells(.Row, "C").Value < "" Then
If IsError(Application.Match(Me.Cells(.Row, "O").Value,
Columns(27), 0)) Then
MsgBox "NO BUDGET IN AGRESSO", vbInformation, "INFORMATION"

End If
End If
End With
End If
Set MyRange = Range("F25:F62")
If Target.Cells.Count = 1 Then
If Not Intersect(Target, Range("F25:F62")) Is Nothing Then
If IsNumeric(Target) Then
budget = WorksheetFunction.VLookup(Target.Offset(0, 9).Value,
Range("AB1:AC9995"), 2, False)
On Error Resume Next
For Each c In MyRange
If c.Address < Target.Address Then
If c.Offset(0, 9).Value = Target.Offset(0, 9).Value Then
budget = budget + c.Value
End If
End If
Next c
On Error GoTo ws_exit
If Target.Value < "" Then
Target.Offset(0, 5).Value = budget
Else
Target.Offset(0, 5).Value = ""
End If
End If
End If
End If
ws_exit:
Application.EnableEvents = True
End Sub
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
Addition? Frodo Excel Discussion (Misc queries) 3 July 22nd 06 01:15 PM
Addition of a macro to an existing Excel file TheShortFox Excel Programming 0 June 28th 06 10:59 AM
Sum vs. Addition davegb Excel Programming 4 May 19th 06 09:03 PM
Addition type macro chip_pyp Excel Discussion (Misc queries) 0 January 18th 06 08:35 PM
row addition Threshold Excel Worksheet Functions 3 March 17th 05 08:08 PM


All times are GMT +1. The time now is 04:39 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"