PDA

View Full Version : RefersTo:=Range [transpose(..)]



PcMax
01-28-2014, 09:28 PM
Hi,

I modified the code you see below:
http://www.excelfox.com/forum/f2/count-unique-number-in-a-column-1645/
With the following code to call the area "Rngx"
How can I rewrite this code to define a range of research?


ActiveWorkbook.Names.Add Name:="Rngx", RefersTo:=Range(Cells(1, Col_Dati), Cells(Cells(Rows.Count, Col_Dati).End(xlUp).Row + 1, Col_Dati))
sn = Split(Join([transpose(Rngx)], "-"), "-")

I hope we can avoid naming the range

Thank you in advance

PcMax
02-06-2014, 04:41 AM
Hi,

I enclose the correct code to load the data selection.


Dim myArray() As String

For Each c In Selection
If Not IsNumeric(c) Then
If Val(c) > 0 Then
ReDim Preserve myArray(i) As String
myArray(i) = c
i = i + 1
End If
End If
Next

sn = Split(Join((myArray), "-"), "-")