LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default function call not returning changed value

I'm sure this must be blindingly obvious to everyone but me, but ....

I have a userform with a list box for user to choose from a list of dates
which determines the start date of a range to be analysed.

My code is in a general module, so I have declared the two variables to hold
the date and the list index globally, in the code general module.

The following is my code.

I can't for the life of me work out why the function correctly assigns the
date value to the list index, as displayed within the function, but on return
to the code the variable is empty!!

aaarrrgghhh!!!


Many thanks for any help -

Matilda




public dStDt as date, iLstIndx as integer


sub mySub()

dStDt = startDateIs(dStDt)
msgbox dStDt ' display results of function on return

end sub



function startDateIs(byVal dStDt) as date


select case iLstIndx

case 0

' set value to dStDt

case 1

'set value to dStDt


etc...

end select

msgbox dStDt 'display results of function

end function
 
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
Function changed hah Excel Worksheet Functions 2 November 10th 08 06:37 PM
Is there a do not call function? pokdbz Excel Discussion (Misc queries) 2 December 27th 07 04:00 PM
Call a Function Desert Piranha[_65_] Excel Programming 3 March 15th 06 03:13 AM
Returning actual page field changed in pivottable Grant Excel Programming 0 September 27th 04 01:02 AM
returning ranges offset from argument range function call Peter Williams Excel Programming 5 February 8th 04 11:59 PM


All times are GMT +1. The time now is 12:15 PM.

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"