difficult concatenate macro

S

stakar

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
 
F

Frank Kabel

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
 
S

stakar

Frank,
You are a specialist !!

Thanks a lot !!



**************
Stathis
Patras - Greec
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top