ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to apply the code to the whole of the worksheet? (https://www.excelbanter.com/excel-programming/447505-how-apply-code-whole-worksheet.html)

sumesh56

how to apply the code to the whole of the worksheet?
 
1 Attachment(s)
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.

Don Guillett[_2_]

how to apply the code to the whole of the worksheet?
 
On Sunday, October 28, 2012 11:45:53 AM UTC-5, sumesh56 wrote:
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|

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







--

sumesh56


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")


All times are GMT +1. The time now is 01:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com