Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Senior Member
 
Posts: 118
Default how to apply the code to the whole of the worksheet?

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.
Attached Files
File Type: zip entry and exit-confirmed.zip (13.2 KB, 69 views)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default 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")
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
Apply code to Icon Gator Excel Programming 3 January 4th 08 10:42 PM
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 05:14 AM
Apply code to other worksheets Metrazal[_6_] Excel Programming 4 February 24th 06 06:57 AM
run code on opening workbook and apply code to certain sheets Jane Excel Programming 7 August 8th 05 09:15 AM
macro to apply worksheet event to active worksheet Paul Simon[_2_] Excel Programming 3 August 7th 03 02:50 AM


All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"