how to apply the code to the whole of the worksheet?

S

sumesh56

i have a worksheet in which "ENTRY" and "EXIT" is entered. entry is fro
A3:D3 and its total comes in E3. exit comes in G3:J3 and its total come
in K3. now E3=k3.
when i enter data in any of the columns of exit and as a result when th
total in col K3 does not tally with that of E3 there should be a erro
message. as per the vbcode in the attached excel file, it works for th
row A3. i wanted to apply the code for the whole of the worksheet. ho
can i accomplish that? thanks

+-------------------------------------------------------------------
|Filename: entry and exit-confirmed.zip
|Download: http://www.excelbanter.com/attachment.php?attachmentid=645
+-------------------------------------------------------------------
 
D

Don Guillett

i have a worksheet in which "ENTRY" and "EXIT" is entered. entry is from

A3:D3 and its total comes in E3. exit comes in G3:J3 and its total comes

in K3. now E3=k3.

when i enter data in any of the columns of exit and as a result when the

total in col K3 does not tally with that of E3 there should be a error

message. as per the vbcode in the attached excel file, it works for the

row A3. i wanted to apply the code for the whole of the worksheet. how

can i accomplish that? thanks.





+-------------------------------------------------------------------+

|Filename: entry and exit-confirmed.zip |

|Download: http://www.excelbanter.com/attachment.php?attachmentid=645|

+-------------------------------------------------------------------+

use
Set EntryRng = Range(Cells(Target.Row, 1), Cells(Target.Row, 4)) ' Range("A3:D3")
Set ExitRng = Range(Cells(Target.Row, "G"), Cells(Target.Row, "J")) ' Range("G3:J3")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top