View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
merjet merjet is offline
external usenet poster
 
Posts: 812
Default Compare values of cells in a range

The following Sub calls your Function with the rng set,
but not "selected", by an InputBox. It could be set in
other ways as well.

Public Sub FindMax()
Dim str1 As String
Dim rng As Range
str1 = InputBox("Enter range of cells, e.g. A1:A10.")
Set rng = Range(str1)
Debug.Print fnCompCells(rng)
End Sub

Hth,
Merjet