Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Code needs to be something like this: Sub Test() Dim UserRange as Range Dim v as variant Dim r as long, c as Integer Set UserRange=Range("A1:AZ3000") ' Change as needed v=UserRange For r = 1 to Ubound(v,1) For c = 1 to Ubound(v,2) ' Perform operation v(r,c)="'" & v(r,c) ' Add ' to field Next c Next r UserRange=v End sub HTH "MDW" wrote: In response to an answer to my earlier question, I'm trying to load the contents of a range into an array, page through it and make some changes, and then dump the changes back into the range. However, I seem to get a "Subscript out of range" error whenever I try to actually change anything in the array. Below is the relevant code: Dim arrCols Set objR = objWS.Range(objWS.Cells(2, J), objWS.Cells(lngCurrentRow, J)) arrCols = objR.Value MsgBox UBound(arrCols) ' In my test ~ 8,000 arrCols(1) = 555555 ' ERROR - tried with "5555555" also objR.Value = arrCols -- Hmm...they have the Internet on COMPUTERS now! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing a range of an array in a SUMPRODUCT formula gives a #N/A error | Excel Discussion (Misc queries) | |||
Error Converting Passed Range into Array in VBA for Excel | Excel Programming | |||
Redim 2D Array Subscript Out Of Range Error | Excel Programming | |||
Subscript Out of Range error in Array... | Excel Programming | |||
Userform array/subsript range error | Excel Programming |