View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default difficult concatenate macro

Hi
try the following macro (puts the return the value in A4)
sub foo()
dim rng as range
dim cell as range
dim ret_str
set rng = range ("A3:AA3")
for each cell in rng
if cell.offset(-2,0).value = "X" then
ret_str = ret_str & cell.value
end if
next
range("A4").value = ret_str
end sub

--
Regards
Frank Kabel
Frankfurt, Germany
"stakar " schrieb im
Newsbeitrag ...
I wanna know if there's a way to do that

i have 20 cells in 2 rows

A B C D .... AA <-- columns
X X X ... <-- cells used as check box
Z Z Z ... Z <-- cells used as headers
1 3 4 5 ... N <-- cells with values

I want to run a macro to concatenate, each time i push a button, all
the cells in a range that they are checked

So if i check the cells A B & D i want
THIS to happen -- =concatenate("A3";"B3";"D3")

Thanks in advance
-----------------------------------------
Stathis
Patras , Greece


---
Message posted from http://www.ExcelForum.com/