Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
tranfer array to range
Hello,
Forgive me if this shows up twice. I neglected the subject line. I am trying to transfer a range to an array, then transfer the values back to a different range, based on a condition. My array is returning "subscript out of range" error. Thanks in advance for any help. Sub TransferData() Dim i As Integer Dim x() x = Range("AG3:AG398") For i = 0 To 397 If IsEmpty(Cells(i + 3, 7)) Then Cells(i + 3, 7).Value = x ( i ) End If Next i End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
tranfer array to range
Does this make sense for you ?
Dim x As Variant x = Range("AG3:AG398").Value Debug.Print LBound(x, 1) & " to " & UBound(x, 1) Debug.Print LBound(x, 2) & " to " & UBound(x, 2) NickHK "AD108" .gbl... Hello, Forgive me if this shows up twice. I neglected the subject line. I am trying to transfer a range to an array, then transfer the values back to a different range, based on a condition. My array is returning "subscript out of range" error. Thanks in advance for any help. Sub TransferData() Dim i As Integer Dim x() x = Range("AG3:AG398") For i = 0 To 397 If IsEmpty(Cells(i + 3, 7)) Then Cells(i + 3, 7).Value = x ( i ) End If Next i End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
tranfer array to range
Yes, I've got it working now. Thanks very much
"NickHK" wrote in message ... Does this make sense for you ? Dim x As Variant x = Range("AG3:AG398").Value Debug.Print LBound(x, 1) & " to " & UBound(x, 1) Debug.Print LBound(x, 2) & " to " & UBound(x, 2) NickHK "AD108" .gbl... Hello, Forgive me if this shows up twice. I neglected the subject line. I am trying to transfer a range to an array, then transfer the values back to a different range, based on a condition. My array is returning "subscript out of range" error. Thanks in advance for any help. Sub TransferData() Dim i As Integer Dim x() x = Range("AG3:AG398") For i = 0 To 397 If IsEmpty(Cells(i + 3, 7)) Then Cells(i + 3, 7).Value = x ( i ) End If Next i End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Tranfer of data via v &/or h lookup | Excel Worksheet Functions | |||
tranfer inf ormation | Excel Discussion (Misc queries) | |||
Pls Help on from date tranfer amount to month | Excel Programming | |||
Tranfer Multiplan files into Excel2003. How? | Setting up and Configuration of Excel | |||
Macros to tranfer data to database | Excel Discussion (Misc queries) |