PC Review


Reply
Thread Tools Rate Thread

Changing values in column 1 and 2 based on values in col 3 & 7

 
 
sonali
Guest
Posts: n/a
 
      29th Apr 2008
I am trying to create micro with requirements as below -

1. cell(2,3) gets focus and if cell(2,1) and cell(2,2) are blank, macro
should put 1 in both.
2. Cell of Any other row (2 onwards) in column 3 gets foucs, cell(row,1)
should copy value of prevois row and cell(row,2) should have incremented
value than previous row.
3. If any cell from col 7 is focuesd and cell(row,3) is bank then
cell(row,3) = cell(row-1,2) and cell(row,1) = cell(row-1,col).

I am using workbook_change event to active above mentioned logic, but is not
working correctly as this event does not get fired while entering values in
the cell for first time. Also sometime application is in infinite loop.
What is the correct way to implement above requirements.


 
Reply With Quote
 
 
 
 
Tim Williams
Guest
Posts: n/a
 
      29th Apr 2008
It would help to show your existing code. To avoid infinite loops when
changing the sheet from within the _change procedure:

Application.EnableEvents = False
'make change to sheet
Application.EnableEvents = True

Be sure to have error-handling code to reset the application events in case
of any error: otherwise this setting will persist even when your macro has
completed.

Tim

"sonali" <(E-Mail Removed)> wrote in message
news78544F6-AD56-426C-A20A-(E-Mail Removed)...
>I am trying to create micro with requirements as below -
>
> 1. cell(2,3) gets focus and if cell(2,1) and cell(2,2) are blank, macro
> should put 1 in both.
> 2. Cell of Any other row (2 onwards) in column 3 gets foucs, cell(row,1)
> should copy value of prevois row and cell(row,2) should have incremented
> value than previous row.
> 3. If any cell from col 7 is focuesd and cell(row,3) is bank then
> cell(row,3) = cell(row-1,2) and cell(row,1) = cell(row-1,col).
>
> I am using workbook_change event to active above mentioned logic, but is
> not
> working correctly as this event does not get fired while entering values
> in
> the cell for first time. Also sometime application is in infinite loop.
> What is the correct way to implement above requirements.
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding numerical values based on multiple values in another column =?Utf-8?B?S2F6bWFuaWFj?= Microsoft Excel Worksheet Functions 6 4th Apr 2007 08:53 PM
summing up values in a column based on values in 3 other columns =?Utf-8?B?QXhlbA==?= Microsoft Excel Programming 4 30th Mar 2007 10:40 PM
changing values in one column based on values in another? QuickLearner Microsoft Excel Programming 1 10th Jul 2006 04:18 PM
Calculating values to column D with formula based on values column A spolk Microsoft Excel Programming 1 30th Apr 2004 06:29 PM
Create Worksheets Based Upon Changing Column Values in XP Gary Microsoft Excel Programming 1 18th Dec 2003 12:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:55 AM.