Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Cell change causes action

How can I fill a cell automatically when a different cell is changed?
For example, D2 contains a rate. When I enter data in any cell in
(d6:d19) I would the adjacent cell in (e6:e19) to be the value of the
cell in d*d2 (Same thing for range f6:f19 and g6:g19)

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Cell change causes action

You can use the Change procedure of the worksheet. Right-click
the sheet tab, choose View Code, and paste in the following code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Application.Intersect(Target, Range("D6:D19")) Is Nothing
Then
Exit Sub
End If
If Target.Cells.Count 1 Then
Exit Sub
End If
Target(1, 2) = Target * Range("D2")
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




wrote in message
oups.com...
How can I fill a cell automatically when a different cell is
changed?
For example, D2 contains a rate. When I enter data in any cell
in
(d6:d19) I would the adjacent cell in (e6:e19) to be the value
of the
cell in d*d2 (Same thing for range f6:f19 and g6:g19)

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Cell change causes action

Just add formula in say E6

=IF(D6="","",$D6*$D$2)

and copy over.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
oups.com...
How can I fill a cell automatically when a different cell is changed?
For example, D2 contains a rate. When I enter data in any cell in
(d6:d19) I would the adjacent cell in (e6:e19) to be the value of the
cell in d*d2 (Same thing for range f6:f19 and g6:g19)

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Cell change causes action

I can determine if the change was in the correct range. I do not know
how to verify the contents are numeric, and then adjust the value in
the adjacent cell.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range(Target.Address), Range("d6:d19")) Is Nothing
Then
MsgBox ("Change in D6:D19 range")
ElseIf Not Intersect(Range(Target.Address), Range("f6:f19")) Is
Nothing Then
MsgBox ("Change in F6:F19 range")
End If
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Cell change causes action

Thanks.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Cell change causes action

I wanted to do this via macro since the "E6:E19" range's values can
also be changed without using the value*rate method.

Thanks.

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
Excell copy action pauses for 15 second for the smallest action Meekal Excel Discussion (Misc queries) 1 January 28th 10 04:30 PM
Change Template Double Click behavior / action Eric Excel Discussion (Misc queries) 1 April 2nd 09 10:21 PM
How to change action of double-click left mouse button? MouseControl Excel Discussion (Misc queries) 1 September 10th 07 11:50 PM
Evaluate cells for change and then action tim Excel Programming 0 February 18th 05 08:43 AM
Automating a date field to change on certain action TODD Excel Programming 3 November 7th 03 05:04 PM


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

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

About Us

"It's about Microsoft Excel"