Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default Event triggered by cell data change/entry

Is there an event that is triggered by changing the data in a
worksheet cell? What is it called?

I have a table that is filled in line by line (row by row). I want
the rows that have not yet been filled in with data to appear
completely blank all the way across. Several columns on the right
contain formulae that process the data entered into the left-hand
columns. I want the process of entering data into one of the
left-hand columns to trigger a macro that writes in the forumulae in
the right-hand columns. Trigger on a single cell, notheing more
complicated than that. Does such a trigger exist?

Right now I'm using an IF(ISBLANK(B13),"",[the real formula]) sort of
formula to accomplish this, but this makes the underlying calculation
of the real formula sort of "inscrutable" which I want to avoid.

The process of using cell formatting to make zero values appear blank
doesn't work because two of the columns are running subtotals and
totals that are not zero, even if the current line contains no data
yet.

Thanks for any help,

Fred Holmes
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Event triggered by cell data change/entry

Fred,

The example code below will copy six columns of formulas from columns C:H
whenever you enter a value into a cell in column B. This assumes that the
formulas exist in the row above the one where you are entering the data.

Copy the code below, right-click the sheet tab, select "View code" and paste
the code into the window that appears. Change the 2 to the column number of
the column that you want to use to trigger the copy, and the 6 to the number
of columns of contiguous formulas to copy.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCol As Integer
Dim intFC As Integer
intCol = 2 'makes this work on column B
intFC = 6 'How many columns to the right of B to copy
If Target.Cells.Count 1 Then Exit Sub
If Target.Column = intCol Then
If Cells(Target.Row, intCol + 1).HasFormula Then Exit Sub
Application.EnableEvents = False
Cells(Target.Row - 1, intCol + 1).Resize(1, intFC).Copy _
Cells(Target.Row, intCol + 1)
Application.EnableEvents = True
End If
End Sub


"Fred Holmes" wrote in message
...
Is there an event that is triggered by changing the data in a
worksheet cell? What is it called?

I have a table that is filled in line by line (row by row). I want
the rows that have not yet been filled in with data to appear
completely blank all the way across. Several columns on the right
contain formulae that process the data entered into the left-hand
columns. I want the process of entering data into one of the
left-hand columns to trigger a macro that writes in the forumulae in
the right-hand columns. Trigger on a single cell, notheing more
complicated than that. Does such a trigger exist?

Right now I'm using an IF(ISBLANK(B13),"",[the real formula]) sort of
formula to accomplish this, but this makes the underlying calculation
of the real formula sort of "inscrutable" which I want to avoid.

The process of using cell formatting to make zero values appear blank
doesn't work because two of the columns are running subtotals and
totals that are not zero, even if the current line contains no data
yet.

Thanks for any help,

Fred Holmes



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Event triggered by cell data change/entry

Fred,

I should also have mentioned that with XL XP or higher, you could simply use
Tools | Options... Edit tab, and check "Extend list formats and formulas"

HTH,
Bernie
MS Excel MVP

"Fred Holmes" wrote in message
...
Is there an event that is triggered by changing the data in a
worksheet cell? What is it called?

I have a table that is filled in line by line (row by row). I want
the rows that have not yet been filled in with data to appear
completely blank all the way across. Several columns on the right
contain formulae that process the data entered into the left-hand
columns. I want the process of entering data into one of the
left-hand columns to trigger a macro that writes in the forumulae in
the right-hand columns. Trigger on a single cell, notheing more
complicated than that. Does such a trigger exist?

Right now I'm using an IF(ISBLANK(B13),"",[the real formula]) sort of
formula to accomplish this, but this makes the underlying calculation
of the real formula sort of "inscrutable" which I want to avoid.

The process of using cell formatting to make zero values appear blank
doesn't work because two of the columns are running subtotals and
totals that are not zero, even if the current line contains no data
yet.

Thanks for any help,

Fred Holmes



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default Event triggered by cell data change/entry

Yes, and presumably with earlier versions, one could select, in the
last used row, the cells in the columns that have formulae, and then
use the fill handle drag down the number of rows one desires. (havent
actually tried it yet) But I'm writing this for someone who is not a
programmer or forumula person or even a real Excel user. He's a
graphic designer who wants a simple, *automatic* "time card" (billable
hours record).

Many thanks for your help.

Fred Holmes

On Thu, 17 Mar 2005 08:57:14 -0500, "Bernie Deitrick" <deitbe @
consumer dot org wrote:

Fred,

I should also have mentioned that with XL XP or higher, you could simply use
Tools | Options... Edit tab, and check "Extend list formats and formulas"

HTH,
Bernie
MS Excel MVP

"Fred Holmes" wrote in message
.. .
Is there an event that is triggered by changing the data in a
worksheet cell? What is it called?

I have a table that is filled in line by line (row by row). I want
the rows that have not yet been filled in with data to appear
completely blank all the way across. Several columns on the right
contain formulae that process the data entered into the left-hand
columns. I want the process of entering data into one of the
left-hand columns to trigger a macro that writes in the forumulae in
the right-hand columns. Trigger on a single cell, notheing more
complicated than that. Does such a trigger exist?

Right now I'm using an IF(ISBLANK(B13),"",[the real formula]) sort of
formula to accomplish this, but this makes the underlying calculation
of the real formula sort of "inscrutable" which I want to avoid.

The process of using cell formatting to make zero values appear blank
doesn't work because two of the columns are running subtotals and
totals that are not zero, even if the current line contains no data
yet.

Thanks for any help,

Fred Holmes



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
Macro triggered by an event AussieAVguy Excel Discussion (Misc queries) 2 June 16th 05 05:51 AM
macro triggered by a change to a cell Lee Excel Programming 2 July 3rd 04 12:04 AM
Worksheet_Change Event triggered off specific cell ExcelMonkey[_142_] Excel Programming 2 June 7th 04 03:33 AM
Help - Change Event triggered on File Save As Dee Veloper Excel Programming 4 October 29th 03 02:16 AM
Make cell entry event change another cell? Ken[_11_] Excel Programming 2 August 7th 03 02:24 PM


All times are GMT +1. The time now is 05:13 AM.

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"