View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
richardbok[_2_] richardbok[_2_] is offline
external usenet poster
 
Posts: 1
Default How to ensure function does not refer to cells outside of workbook?

I have written a function that searches for the lowest value in on
workbook... but this workbook is opened together with other workbook
for analysis.

Part of my function is as follows:
If LowestRate Cells(rngStart.Row, lngCol).value Then
LowestRate = Cells(rngStart.Row, lngCol).value

And I perform within my workbook, =search_lowest(O11,2) where the dat
to be search is from O11 to the last column.

Everytime I opened a new workbook, it seems that the reference goes t
a new workbook's O11 to last column. How do I ensure that does no
happen? Do I specify the full path of the workbook, worksheet in m
module? If so, what is the syntax for that? Thanks.

r

--
Message posted from http://www.ExcelForum.com