Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Since you asked...
I'd say what you have here is easy to understand/maintain for the few target ranges you have in your sample code. Claus' approach is more efficient. I'm inclined to populate all cells receiving the source values in one shot since the sync is the same for all target cells... Const sRng1$ = "F13,F16,F19,I13,I16,I19,L13,K17" Const sRng2$ = "F3,A3,A20,L5:C3,B5,B20,L6:D3,C7,C20,L7" _ & ":I3,D9,D20,L8:J3,E11,E20,L9:M3,F13,F20,L10" _ & ":O3,G15,G20,L11:P3,H17,H20,L12" ...where sRng2 is a delimited string of delimited strings, the latter being the target cells to be passed as the range addresses for the target array as follows... Sub XferVals2(Optional sSrc$, Optional sTgt$) Dim va1, va2, i% If sSrc = "" Then sSrc = sRng1: If sTgt = "" Then sTgt = sRng2 va1 = Split(sSrc, ",") If InStr(1, sTgt, ":") 0 _ Then va2 = Split(sTgt, ":") _ Else va2 = Split(sTgt, ",") For i = LBound(va1) To UBound(va1) Range(va2(i)).Value = Range(va1(i)).Value Next 'i End Sub ...so you can now have it both ways<g! -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
RENEWED-- Arrays: Counting multiple values within array | Excel Worksheet Functions | |||
How do you create an Array of Arrays? | Excel Programming | |||
How do you create an Array of Arrays? | Excel Programming | |||
Creating a single vertical array from multiple column arrays | Excel Worksheet Functions | |||
Array of Arrays in VBA | Excel Programming |