Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default strange vba interaction

hi all!

i have some vba code that is located on the worksheet it refers to, inside
the sub

Private Sub Worksheet_Change(ByVal Target As Range)

what the code basically does is based on the users choice, some decisions
are made as to what goes in the next three adjacent cells (same row,
continuing to the right) and if the users input is further required, the user
is prompted for input.

this code works fine and dandy

in another cell (same row, 2 columns to the left of where the user makes
their choice)

is this code (in B14):

=IF(C14="","",WhatIsLeft(D14,From))

C14 is either off ("") or a number from 1 to 20 (it's a line item number)
D14 is the users choice
From is a named range consisting of a single cell.

this is the code for the function WhatIsLeft(String, String)

Public Function WhatIsLeft(lot As String, warehouse As String)
WhatIsLeft = 64
End Function

64 is just a test value, i haven't written the complete function yet.

after i put the formula in B14, the cells E14,G14 and H14 will not 'update'

i have run the debugger and the Worksheet_Change sub gets triggered, and
gets to a point where the 'From' cell is modified, jumps to the WhatIsLeft
function (which it shouldn't) - and quits.

i can't find an error anywhere.

any ideas there?

hopefully i explained this clear enough.

tia

J

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default strange vba interaction

the cell in from does not actually get modified when this 'interaction'
occurs - but the value returned by WhatIsLeft appears.
when the B14 is cleared, the whole thing works again.

"Gixxer_J_97" wrote:

hi all!

i have some vba code that is located on the worksheet it refers to, inside
the sub

Private Sub Worksheet_Change(ByVal Target As Range)

what the code basically does is based on the users choice, some decisions
are made as to what goes in the next three adjacent cells (same row,
continuing to the right) and if the users input is further required, the user
is prompted for input.

this code works fine and dandy

in another cell (same row, 2 columns to the left of where the user makes
their choice)

is this code (in B14):

=IF(C14="","",WhatIsLeft(D14,From))

C14 is either off ("") or a number from 1 to 20 (it's a line item number)
D14 is the users choice
From is a named range consisting of a single cell.

this is the code for the function WhatIsLeft(String, String)

Public Function WhatIsLeft(lot As String, warehouse As String)
WhatIsLeft = 64
End Function

64 is just a test value, i haven't written the complete function yet.

after i put the formula in B14, the cells E14,G14 and H14 will not 'update'

i have run the debugger and the Worksheet_Change sub gets triggered, and
gets to a point where the 'From' cell is modified, jumps to the WhatIsLeft
function (which it shouldn't) - and quits.

i can't find an error anywhere.

any ideas there?

hopefully i explained this clear enough.

tia

J

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default strange vba interaction

You didn't post your code (or better a dumbed down version of your Change
event code that duplicates the problem) so I can't "see" the problem. But
I'm not sure I have to. Over the years I've seen a lot of peculiarities
with UDFs and, as a result, I do not use them. Just say no.

--
Jim
"Gixxer_J_97" wrote in message
...
| the cell in from does not actually get modified when this 'interaction'
| occurs - but the value returned by WhatIsLeft appears.
| when the B14 is cleared, the whole thing works again.
|
| "Gixxer_J_97" wrote:
|
| hi all!
|
| i have some vba code that is located on the worksheet it refers to,
inside
| the sub
|
| Private Sub Worksheet_Change(ByVal Target As Range)
|
| what the code basically does is based on the users choice, some
decisions
| are made as to what goes in the next three adjacent cells (same row,
| continuing to the right) and if the users input is further required, the
user
| is prompted for input.
|
| this code works fine and dandy
|
| in another cell (same row, 2 columns to the left of where the user makes
| their choice)
|
| is this code (in B14):
|
| =IF(C14="","",WhatIsLeft(D14,From))
|
| C14 is either off ("") or a number from 1 to 20 (it's a line item
number)
| D14 is the users choice
| From is a named range consisting of a single cell.
|
| this is the code for the function WhatIsLeft(String, String)
|
| Public Function WhatIsLeft(lot As String, warehouse As String)
| WhatIsLeft = 64
| End Function
|
| 64 is just a test value, i haven't written the complete function yet.
|
| after i put the formula in B14, the cells E14,G14 and H14 will not
'update'
|
| i have run the debugger and the Worksheet_Change sub gets triggered, and
| gets to a point where the 'From' cell is modified, jumps to the
WhatIsLeft
| function (which it shouldn't) - and quits.
|
| i can't find an error anywhere.
|
| any ideas there?
|
| hopefully i explained this clear enough.
|
| tia
|
| J
|


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
Curious interaction W/Win Exp. Jim H. Excel Discussion (Misc queries) 6 August 5th 08 09:38 PM
how set up regression for interaction? Arun Excel Discussion (Misc queries) 1 August 28th 06 12:10 PM
... interaction with Word ... Dr. Darrell Excel Discussion (Misc queries) 2 July 21st 05 10:42 PM
Interaction between worksheets teresa Excel Programming 1 December 1st 04 10:22 AM
Web interaction Nigel[_6_] Excel Programming 3 February 20th 04 08:34 AM


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