Nori,
One possibility is that the data is not on the active sheet in which case you would need to qualify both the range and the cells objects with the sheet reference and possibly also the work book. The code below seems to work fine for data held in the range A1 to O2 in sheet1 of book1 and it works from any additional workbook I have open.
Apart from that, I can't think what's wrong
My code is below
Public Function ConcRange(substrings As Range)
Dim CLL As Variant
For Each CLL In substrings.Cells
ConcRange = ConcRange & CLL.Value
Next CLL
ConcRange = Mid$(ConcRange, 1)
End Function
Sub UseConcRange()
Dim rw As Long
Dim rStr As String
For rw = 1 To 2
With Workbooks("book1").Sheets("sheet1")
rStr = ConcRange(.Range(.Cells(rw, 1), .Cells(rw, 15)))
End With
MsgBox rStr
Next rw
End Sub
|