ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   range values (https://www.excelbanter.com/excel-programming/397416-range-values.html)

geebee

range values
 
hi,

i would like to know if there is a way to take a range of cells like say
from A2 to A15, and read those values, putting thm into an array. and then
displaying them.. separated by commas in cell A1 (ONE cell only) of another
sheet?

Thanks in advance,
geebee


Tom Ogilvy

range values
 
Sub ABC()
Dim cell as Range, s as String
for each cell in Worksheets("Sheet1").Range("A2:A15")
s = s & cell.value & ","
Next
worksheets("Sheet2").Range("B9").Value = Left(s,Len(s)-1)
End Sub

--
regards,
Tom Ogilvy


"geebee" wrote:

hi,

i would like to know if there is a way to take a range of cells like say
from A2 to A15, and read those values, putting thm into an array. and then
displaying them.. separated by commas in cell A1 (ONE cell only) of another
sheet?

Thanks in advance,
geebee



All times are GMT +1. The time now is 07:25 PM.

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