Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tranfer of data via v &/or h lookup Swithin Excel Worksheet Functions 0 April 27th 09 10:09 AM
tranfer inf ormation minimoi Excel Discussion (Misc queries) 0 March 9th 09 09:40 PM
Pls Help on from date tranfer amount to month Tiya Excel Programming 3 July 4th 06 05:36 PM
Tranfer Multiplan files into Excel2003. How? Multiguy Setting up and Configuration of Excel 0 March 31st 05 04:03 AM
Macros to tranfer data to database Scribner Excel Discussion (Misc queries) 1 February 10th 05 01:08 AM


All times are GMT +1. The time now is 11:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"