ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   difficult concatenate macro (https://www.excelbanter.com/excel-programming/293290-difficult-concatenate-macro.html)

stakar[_2_]

difficult concatenate macro
 
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/


Frank Kabel

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/



stakar[_4_]

difficult concatenate macro
 
Frank,
You are a specialist !!

Thanks a lot !!



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

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



All times are GMT +1. The time now is 12:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com