R
r
Hello,
Reflected these exceptions on the properties address and range, you are
aware of the problem?
Option Explicit
'ATTENZIONE!
'Comportamento non documentato di
'Address riferito a Range
'Rng.Address restituisce fino a 257
'caratteri
Sub test_Address()
Dim rng As Excel.Range
Dim i As Long
Dim s As String
Set rng = [a1]
For i = 3 To 200 Step 2
Set rng = Application.Union(rng, Evaluate("a" & i))
Next
rng.Select
[a1] = rng.Address
Debug.Print Len(rng.Address)
End Sub
Public Sub m()
Dim rng As Range
Dim s As String
Set rng = Range("A1")
s = "C$1,$A$1,$A$3,$A$5,$A$7,$A$9,$A$11,$A$13,$A$15," _
& "$A$17,$A$19,$A$21,$A$23,$A$25,$A$27,$A$29," _
& "$A$31,$A$33,$A$35,$A$37,$A$39,$A$41,$A$43," _
& "$A$45,$A$47,$A$49,$A$51,$A$53,$A$55,$A$57," _
& "$A$59,$A$61,$A$63,$A$65,$A$67,$A$69,$A$71," _
& "$A$73,$A$75,$A$77,$A$79,$A$81,$A$83,$A$85"
Debug.Print Len(s) '257
Set rng = Range(s) 'error
rng.Select
Set rng = Nothing
End Sub
Public Sub m2()
Dim rng As Range
Dim s As String
Set rng = Range("A1")
s = "$C$1,$C$3,$A$1,$A$3,$A$5,$A$7,$A$9,$A$11,$A$13,$A$15," _
& "$A$17,$A$19,$A$21,$A$23,$A$25,$A$27,$A$29," _
& "$A$31,$A$33,$A$35,$A$37,$A$39,$A$41,$A$43," _
& "$A$45,$A$47,$A$49,$A$51,$A$53,$A$55,$A$57," _
& "$A$59,$A$61,$A$63,$A$65,$A$67,$A$69,$A$71," _
& "$A$73,$A$75,$A$77,$A$79,$A$81,$A$83"
Debug.Print Len(s) '256
Set rng = Range(s) 'error
rng.Select
Set rng = Nothing
End Sub
Public Sub m3()
Dim rng As Range
Dim s As String
Set rng = Range("A1")
s = "$C$5,$C$1,$C$3,$A$1,$A$3,$A$5,$A$7,$A$9,$A$11,$A$13,$A$15," _
& "$A$17,$A$19,$A$21,$A$23,$A$25,$A$27,$A$29," _
& "$A$31,$A$33,$A$35,$A$37,$A$39,$A$41,$A$43," _
& "$A$45,$A$47,$A$49,$A$51,$A$53,$A$55,$A$57," _
& "$A$59,$A$61,$A$63,$A$65,$A$67,$A$69,$A$71," _
& "$A$73,$A$75,$A$77,$A$79,$A$81"
Debug.Print Len(s) '255
Set rng = Range(s) 'ok
rng.Select
Set rng = Nothing
End Sub
regards
r
Reflected these exceptions on the properties address and range, you are
aware of the problem?
Option Explicit
'ATTENZIONE!
'Comportamento non documentato di
'Address riferito a Range
'Rng.Address restituisce fino a 257
'caratteri
Sub test_Address()
Dim rng As Excel.Range
Dim i As Long
Dim s As String
Set rng = [a1]
For i = 3 To 200 Step 2
Set rng = Application.Union(rng, Evaluate("a" & i))
Next
rng.Select
[a1] = rng.Address
Debug.Print Len(rng.Address)
End Sub
Public Sub m()
Dim rng As Range
Dim s As String
Set rng = Range("A1")
s = "C$1,$A$1,$A$3,$A$5,$A$7,$A$9,$A$11,$A$13,$A$15," _
& "$A$17,$A$19,$A$21,$A$23,$A$25,$A$27,$A$29," _
& "$A$31,$A$33,$A$35,$A$37,$A$39,$A$41,$A$43," _
& "$A$45,$A$47,$A$49,$A$51,$A$53,$A$55,$A$57," _
& "$A$59,$A$61,$A$63,$A$65,$A$67,$A$69,$A$71," _
& "$A$73,$A$75,$A$77,$A$79,$A$81,$A$83,$A$85"
Debug.Print Len(s) '257
Set rng = Range(s) 'error
rng.Select
Set rng = Nothing
End Sub
Public Sub m2()
Dim rng As Range
Dim s As String
Set rng = Range("A1")
s = "$C$1,$C$3,$A$1,$A$3,$A$5,$A$7,$A$9,$A$11,$A$13,$A$15," _
& "$A$17,$A$19,$A$21,$A$23,$A$25,$A$27,$A$29," _
& "$A$31,$A$33,$A$35,$A$37,$A$39,$A$41,$A$43," _
& "$A$45,$A$47,$A$49,$A$51,$A$53,$A$55,$A$57," _
& "$A$59,$A$61,$A$63,$A$65,$A$67,$A$69,$A$71," _
& "$A$73,$A$75,$A$77,$A$79,$A$81,$A$83"
Debug.Print Len(s) '256
Set rng = Range(s) 'error
rng.Select
Set rng = Nothing
End Sub
Public Sub m3()
Dim rng As Range
Dim s As String
Set rng = Range("A1")
s = "$C$5,$C$1,$C$3,$A$1,$A$3,$A$5,$A$7,$A$9,$A$11,$A$13,$A$15," _
& "$A$17,$A$19,$A$21,$A$23,$A$25,$A$27,$A$29," _
& "$A$31,$A$33,$A$35,$A$37,$A$39,$A$41,$A$43," _
& "$A$45,$A$47,$A$49,$A$51,$A$53,$A$55,$A$57," _
& "$A$59,$A$61,$A$63,$A$65,$A$67,$A$69,$A$71," _
& "$A$73,$A$75,$A$77,$A$79,$A$81"
Debug.Print Len(s) '255
Set rng = Range(s) 'ok
rng.Select
Set rng = Nothing
End Sub
regards
r