Home |
Search |
Today's Posts |
#9
![]() |
|||
|
|||
![]() Quote:
Apologies for a delay in response. I wasn't feeling well and couldn't see your message. I thought you are always going to use only 1 row. Here is a small edit that you need to make in the code. replace the worksheet_change code in the thisworkbook object with the following code. Private Sub Worksheet_Change(ByVal Target As Range) Dim CheckRng As Range Dim EntryRng As Range Dim ExitRng As Range Set EntryRng = Range(Cells(Target.Row, 1), Cells(Target.Row, 4)) Set ExitRng = Range(Cells(Target.Row, 7), Cells(Target.Row, 10)) Set CheckRng = Application.Union(EntryRng, ExitRng) If Not Application.Intersect(Target, CheckRng) Is Nothing Then If Application.WorksheetFunction.CountBlank(EntryRng) = 0 And Application.WorksheetFunction.CountBlank(ExitRng) = 0 Then If Application.WorksheetFunction.Sum(EntryRng) < Application.WorksheetFunction.Sum(ExitRng) Then MsgBox "The Entry Total is not matching with Exit Total", vbCritical, "Error" Application.EnableEvents = False Application.Undo Application.EnableEvents = True Exit Sub End If End If End If End Sub Hope this helps. Prashant |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
conditional formatting for wrongly entered 9 digit numbers | Excel Programming | |||
Using a Macro in Excel 2004 to move entered data from one sheet toanother and space between rows when next data is entered? | Excel Programming | |||
List Box - Option If wrongly selected | Excel Programming | |||
Time displaying wrongly | Excel Discussion (Misc queries) | |||
sorry i put wrongly for padded leading 0 | Excel Programming |