In Excel 2010 I have a VBA function which searches a worksheet and finds a match based on three values. Once it finds the match it returns a range which is an entire row of data. Now in my Excel worksheet in one cell I call that function. Using a formula can I split that range into individual cells. It would basically be like find the row and then copy paste the cells starting at the calling cell. The only thing I can think of is to save the range in a cell
A1 = {my range}
and then each cell after that use an INDEX function like
A2 = INDEX(A1, 1,1)
A3 = INDEX(A1, 1,2)
A4 = INDEX(A1, 1,3)
Looking for any suggestions. I could have sworn there was a non-VBA function that I could use that would split out a range into individual cells.
Edit with an example: In my main worksheet I have tons of data and some of it has errors. Those with errors I look up in another worksheet.
main worksheet
status, height, width, weight, sheet, m, d, z, e
ok, 1, 2, 5, , 100, 5, 7, 5
err, 1, 2, 6, TEMPA
err, 1, 2, 7, TEMPA
ok, 1, 2, 8, , 102, 7, 9, 8
ok, 1, 2, 9, , 104, 8, 7, 0
the combo of height, width, and weight are unique. the helper woksheets are the same as the main but will have the data that is missing.
TEMPA
ok, 1, 2, 6, , 25, 66, 0, 1
ok, 1, 2, 7, , 99, 7, 2, 6
So in essence I want to join the two on height, width, and weight but only for those that have an error. The name of the helper worksheet will vary but that is pre-calculated. I have the code written to take the three unique conditions, go to the helper worksheet, make a match and then return the range object consisting of the matching row.
function GetMyRange(h, wd, wt, sht) as Range
'do the match here
end function
The function works as I can setup some debug statements and I'm making the correct matches. However back in the main worksheet how do i take my range object and put the individual elements of the range object into each cell to "fix" the errors?