Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Problem identified?

Phil - Please don't change subjects. It makes it impossible for
Google to archive a thread.

Here's a workaround. I've updated the demo file as well:

ftp://ftp.mcgimpsey.com/excel/ph_demo.xls

Private Sub Worksheet_Change(ByVal Target As Range)
Dim nRow As Long
Dim dV As Double
Dim dP As Double
Dim nStart As Long
With Target
If .Count 1 Then Exit Sub
If Not Intersect(.Cells, Range( _
"U19:U30,AD19:AD30,AM19:AM30,AV19:AV30," & _
"U51:U62,AD51:AD62,AM51:AM62,AV51:AV62," & _
"U83:U94,AD83:AD94,AM83:AM94,AV83:AV94")) _
Is Nothing Then
nStart = 10 - 32 * ((.Row = 51) + (.Row = 83))
nRow = (.Column - 21) / 9
dV = Range("V" & nStart).Offset(nRow, 0).Value
dP = Range("P" & nStart).Offset(nRow, 0).Value
If Not dP = dV Then
Application.EnableEvents = False
.Offset(0, 3).Value = (.Value - dV) / (dP - dV)
Application.EnableEvents = True
End If
End If
End With
End Sub

In article ,
"Phil Hageman" wrote:

Tom, Maybe you've hit on something here - it is obvious to
me, but wouldn't be to you, and I have been passing over
it every time I communicate with you folks. Makes me
wonder what else I'm not telling you...

It is possible some "P", "V", and "U" cells may hold no
values - this is a legitimate circumstance for the user.
Sounds like this may be my problem - the cause of blank
and #Div/0!answers. Can you: 1.) modify the code to work
around blank cells (dp - dv < 0), and 2.) make it work in
all three regions of the worksheet independent of cell
entries.

Is it possible for me to send you the worksheet via e-mail?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Code Udated - No Change

Mr. McGimpsey, I confess to ignorance with the vinacular
here. How did I change the subject? I'll try not to do it
again. I don't understand the statement "It makes
it...Google...thread.

I came up on the ftp:... and it shows an .xls sheet with
the numbers, nothing more (answers are correct). Presume
this is all I'm supppose to see. I updated to your code
below with no response. Could the fact that my computer
will not capitalize the word "range" in the code mean VBA
will not recongize portions of the code? I sincerely
believe your efforts should be producing results, and that
the problem is simply me. Please bear with me - I'll try
whatever it takes. Could I sent the worksheet?

Thanks, Phil

-----Original Message-----
Phil - Please don't change subjects. It makes it

impossible for
Google to archive a thread.

Here's a workaround. I've updated the demo file as well:

ftp://ftp.mcgimpsey.com/excel/ph_demo.xls

Private Sub Worksheet_Change(ByVal Target As Range)
Dim nRow As Long
Dim dV As Double
Dim dP As Double
Dim nStart As Long
With Target
If .Count 1 Then Exit Sub
If Not Intersect(.Cells, Range( _
"U19:U30,AD19:AD30,AM19:AM30,AV19:AV30

," & _
"U51:U62,AD51:AD62,AM51:AM62,AV51:AV62

," & _
"U83:U94,AD83:AD94,AM83:AM94,AV83:AV94

")) _
Is Nothing Then
nStart = 10 - 32 * ((.Row = 51) + (.Row
= 83))
nRow = (.Column - 21) / 9
dV = Range("V" & nStart).Offset(nRow,

0).Value
dP = Range("P" & nStart).Offset(nRow,

0).Value
If Not dP = dV Then
Application.EnableEvents = False
.Offset(0, 3).Value = (.Value - dV) /

(dP - dV)
Application.EnableEvents = True
End If
End If
End With
End Sub

In article ,
"Phil Hageman"

wrote:

Tom, Maybe you've hit on something here - it is obvious

to
me, but wouldn't be to you, and I have been passing

over
it every time I communicate with you folks. Makes me
wonder what else I'm not telling you...

It is possible some "P", "V", and "U" cells may hold no
values - this is a legitimate circumstance for the

user.
Sounds like this may be my problem - the cause of blank
and #Div/0!answers. Can you: 1.) modify the code to

work
around blank cells (dp - dv < 0), and 2.) make it work

in
all three regions of the worksheet independent of cell
entries.

Is it possible for me to send you the worksheet via e-

mail?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Code Udated - No Change

Phil,
I would assume you are supposed to change the number in column X19 for
example and see that the code is correctly updating the appropriate cells?
Then look in the worksheet code module and use the code there in your
workbook.

To correct your range problem. First make sure you don't have

Dim range as Range
or have range as an argument to a function.

then go to a general module and put in

Public Range as String

Then select the declaration and delete it.

This should clear up your capitalization problem although I don't think it
is contributing to whatever problem you seem to think you are having.

JE was referring to you changing the subject line in your post.


--
Regards,
Tom Ogilvy

"Phil Hageman" wrote in message
...
Mr. McGimpsey, I confess to ignorance with the vinacular
here. How did I change the subject? I'll try not to do it
again. I don't understand the statement "It makes
it...Google...thread.

I came up on the ftp:... and it shows an .xls sheet with
the numbers, nothing more (answers are correct). Presume
this is all I'm supppose to see. I updated to your code
below with no response. Could the fact that my computer
will not capitalize the word "range" in the code mean VBA
will not recongize portions of the code? I sincerely
believe your efforts should be producing results, and that
the problem is simply me. Please bear with me - I'll try
whatever it takes. Could I sent the worksheet?

Thanks, Phil

-----Original Message-----
Phil - Please don't change subjects. It makes it

impossible for
Google to archive a thread.

Here's a workaround. I've updated the demo file as well:

ftp://ftp.mcgimpsey.com/excel/ph_demo.xls

Private Sub Worksheet_Change(ByVal Target As Range)
Dim nRow As Long
Dim dV As Double
Dim dP As Double
Dim nStart As Long
With Target
If .Count 1 Then Exit Sub
If Not Intersect(.Cells, Range( _
"U19:U30,AD19:AD30,AM19:AM30,AV19:AV30

," & _
"U51:U62,AD51:AD62,AM51:AM62,AV51:AV62

," & _
"U83:U94,AD83:AD94,AM83:AM94,AV83:AV94

")) _
Is Nothing Then
nStart = 10 - 32 * ((.Row = 51) + (.Row
= 83))
nRow = (.Column - 21) / 9
dV = Range("V" & nStart).Offset(nRow,

0).Value
dP = Range("P" & nStart).Offset(nRow,

0).Value
If Not dP = dV Then
Application.EnableEvents = False
.Offset(0, 3).Value = (.Value - dV) /

(dP - dV)
Application.EnableEvents = True
End If
End If
End With
End Sub

In article ,
"Phil Hageman"

wrote:

Tom, Maybe you've hit on something here - it is obvious

to
me, but wouldn't be to you, and I have been passing

over
it every time I communicate with you folks. Makes me
wonder what else I'm not telling you...

It is possible some "P", "V", and "U" cells may hold no
values - this is a legitimate circumstance for the

user.
Sounds like this may be my problem - the cause of blank
and #Div/0!answers. Can you: 1.) modify the code to

work
around blank cells (dp - dv < 0), and 2.) make it work

in
all three regions of the worksheet independent of cell
entries.

Is it possible for me to send you the worksheet via e-

mail?
.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Code Udated - No Change

See my minor addtion in the thread "Capitalization in Declarations"

In article ,
"Tom Ogilvy" wrote:

Phil,
I would assume you are supposed to change the number in column X19 for
example and see that the code is correctly updating the appropriate cells?
Then look in the worksheet code module and use the code there in your
workbook.

To correct your range problem. First make sure you don't have

Dim range as Range
or have range as an argument to a function.

then go to a general module and put in

Public Range as String

Then select the declaration and delete it.

This should clear up your capitalization problem although I don't think it
is contributing to whatever problem you seem to think you are having.

JE was referring to you changing the subject line in your post.

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
VBA code Help needed liamothelegend Excel Programming 1 November 5th 03 12:25 PM
Code Tweek Needed Phil Hageman Excel Programming 0 October 7th 03 07:21 PM
code needed ibo Excel Programming 0 July 29th 03 05:32 PM


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