#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default event fire

I am missing something and am stumped. Have the following code in the
workbook I want it to run when an entry is made in column 'J' or '10'
reference Then subtract
10.00 amd take the remaining amount and place this and other data in row in
columns 'E F G H I' into donors worksheet. This is my first attempt at this
event happening. Anyway here is code
Any takers?
Thanks
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal target As Range)

Select Case Sh.Name
Case "Data", "Motorcycle", "Indian", "Native"
'1=Data 6=Motorcycle 7=Indian 8=Native
If target.Column = 10 And target.Value 10 Then Call _
CopyStuff(target)
End Select


End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default event fire


Your explanation was not clear to me.
I've found that if you can describe exactly what you want to do
then writing the code becomes much easier.
Here is my interpretation. The code goes in the ThisWorkbook module.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
Dim dblValue As Double
Dim varTargetAmt As Variant
varTargetAmt = Target.Cells(1, 1).Value

Select Case Sh.Name
Case "Data"
If Target.Column = 1 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
Case "Motorcycle"
If Target.Column = 6 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
Case "Indian"
If Target.Column = 7 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
Case "Native"
If Target.Column = 8 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
End Select
If dblValue 0 Then
Me.Worksheets("doner").Range("E2:I2").Value = _
Array(dblValue, 10, 20, 30, 40)
End If
End Sub
'-----------



"Curt"
wrote in message
I am missing something and am stumped. Have the following code in the
workbook I want it to run when an entry is made in column 'J' or '10'
reference Then subtract
10.00 amd take the remaining amount and place this and other data in row in
columns 'E F G H I' into donors worksheet. This is my first attempt at this
event happening. Anyway here is code
Any takers?
Thanks
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal target As Range)
Select Case Sh.Name
Case "Data", "Motorcycle", "Indian", "Native"
'1=Data 6=Motorcycle 7=Indian 8=Native
If target.Column = 10 And target.Value 10 Then Call _
CopyStuff(target)
End Select
End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default event fire

studying your code it would seem I don't need copystuff copying could be done
within the code you wrote? I lack knowledge to understand the last about
Doners worksheet in your code. Hope what I sent clears the water
Thank you

"Jim Cone" wrote:


Your explanation was not clear to me.
I've found that if you can describe exactly what you want to do
then writing the code becomes much easier.
Here is my interpretation. The code goes in the ThisWorkbook module.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
Dim dblValue As Double
Dim varTargetAmt As Variant
varTargetAmt = Target.Cells(1, 1).Value

Select Case Sh.Name
Case "Data"
If Target.Column = 1 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
Case "Motorcycle"
If Target.Column = 6 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
Case "Indian"
If Target.Column = 7 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
Case "Native"
If Target.Column = 8 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
End Select
If dblValue 0 Then
Me.Worksheets("doner").Range("E2:I2").Value = _
Array(dblValue, 10, 20, 30, 40)
End If
End Sub
'-----------



"Curt"
wrote in message
I am missing something and am stumped. Have the following code in the
workbook I want it to run when an entry is made in column 'J' or '10'
reference Then subtract
10.00 amd take the remaining amount and place this and other data in row in
columns 'E F G H I' into donors worksheet. This is my first attempt at this
event happening. Anyway here is code
Any takers?
Thanks
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal target As Range)
Select Case Sh.Name
Case "Data", "Motorcycle", "Indian", "Native"
'1=Data 6=Motorcycle 7=Indian 8=Native
If target.Column = 10 And target.Value 10 Then Call _
CopyStuff(target)
End Select
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default event fire

wonderful code put data where wanted but not wanted data. target column on
all sheets is 10 or 'J' we subtract 10.00 from this cell then copy data from
cells
E-F-G-H-I-J(-10.00)-K To Donors worksheet Column 'J' is formated to
currency other cells are data Hope I make sense.
Thank You

"Jim Cone" wrote:


Your explanation was not clear to me.
I've found that if you can describe exactly what you want to do
then writing the code becomes much easier.
Here is my interpretation. The code goes in the ThisWorkbook module.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
Dim dblValue As Double
Dim varTargetAmt As Variant
varTargetAmt = Target.Cells(1, 1).Value

Select Case Sh.Name
Case "Data"
If Target.Column = 1 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
Case "Motorcycle"
If Target.Column = 6 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
Case "Indian"
If Target.Column = 7 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
Case "Native"
If Target.Column = 8 And varTargetAmt 10 Then
dblValue = varTargetAmt - 10
End If
End Select
If dblValue 0 Then
Me.Worksheets("doner").Range("E2:I2").Value = _
Array(dblValue, 10, 20, 30, 40)
End If
End Sub
'-----------



"Curt"
wrote in message
I am missing something and am stumped. Have the following code in the
workbook I want it to run when an entry is made in column 'J' or '10'
reference Then subtract
10.00 amd take the remaining amount and place this and other data in row in
columns 'E F G H I' into donors worksheet. This is my first attempt at this
event happening. Anyway here is code
Any takers?
Thanks
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal target As Range)
Select Case Sh.Name
Case "Data", "Motorcycle", "Indian", "Native"
'1=Data 6=Motorcycle 7=Indian 8=Native
If target.Column = 10 And target.Value 10 Then Call _
CopyStuff(target)
End Select
End Sub

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
Can't get Sheet_Change event to fire - please help [email protected] Excel Programming 4 November 30th 06 04:28 AM
Validation list changes don't fire an event MrAlb Excel Programming 3 September 20th 06 12:27 AM
Event doesn't fire Frank Xia Excel Discussion (Misc queries) 6 February 11th 06 12:54 AM
Workbook Open Event does not fire Jon Somerset Excel Programming 1 October 15th 04 12:49 PM
Event class doesn't fire in embedded VBA Tornados[_5_] Excel Programming 0 September 28th 04 03:27 PM


All times are GMT +1. The time now is 02:07 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"