Átalakított táblázat, szintén két oszloppal.
- Kód: Egész kijelölése KinyitásÖsszecsukás
alma | Jonathan, Idared, Gold, Gála, Starking
körte | Bosc kobak, Vilmos, Clapp kedveltje, Piros Vilmos, Bohusné
cseresznye | Szomolyai, Germersdorfi óriás, Sunbrust, Carmen, Bigarreau Burlat
REM ***** BASIC *****
Option Explicit
Function ConcatIf(Condition as string, MyRange as Array, Separator as string)
Dim Result as string
Dim iRow as Integer
'LoadXray
'Xray MyRange
Result = ""
if NOT IsArray(MyRange) Then
Result = "Hibás átadott tartomány"
else
if UBound(MyRange, 2) <> 2 then
Result = "Nem kétoszlopos az átadott tartomány"
else
for iRow = LBound(MyRange, 1) To UBound(MyRange, 1)
If MyRange(iRow, 1) = Condition then
If Result = "" then
Result = Result + MyRange(iRow,2)
else
Result = Result + Separator + MyRange(iRow,2)
end if
end if
next
end if
end If
ConcatIf = Result
End function
REM ***** BASIC *****
Option Explicit
Function ConcatIf(Condition as string, MyRange as Array, Separator as string)
Dim Result as string
Dim iRow as Integer
LoadXray
'Xray MyRange
Result = ""
if NOT IsArray(MyRange) Then
Result = "Hibás átadott tartomány"
else
if UBound(MyRange, 2) <> 2 then
Result = "Nem kétoszlopos az átadott tartomány"
else
for iRow = LBound(MyRange, 1) To UBound(MyRange, 1)
If MyRange(iRow, 1) = Condition then
If Result = "" then
Result = Result + MyRange(iRow,2)
else
Result = Result + Separator + MyRange(iRow,2)
end if
end if
next
end if
end If
ConcatIf = Result
End function]
A számsor növekszik és nem fordul elő újra.
Egyszerűen csak valamikor adott számhoz egy ember tartozik, máskor meg véletlenszerűen öt ember tartozik ugyanahoz a számhoz és ez öt sorban van.
Őket szeretném összerántani egy cellába szóközzel vagy vesszővel.
A tiéd "csak" összerántotta a mezőket, de nem csinálta az ötös ismétlődéseknél az összerántást.
Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 1 vendég