Julie,
Thanks for your help on this. So far I haven't been able to ge
the macro to work quite right, but I think it has to do with my no
customizing the variables correctly. I have attached a version of th
file that better shows exactly how my columns and rows are laid out.
The column containing the floor numbers is column E and the floor
start at row 5. Heading right from there on the same sheet (everythin
is on one sheet) the first year column (2004) in the "graph" area start
in column L. The years I want to scan go all the way to column Y.
want the concatenated data for each year to appear in cells in row 9
from columns L to Y (the full range of years in the Graph).
I attempted to change the variables in your code to fit those cel
ranges, but I was unsucessful. I was a little confused as to th
numbering system. You said "A=69" as far as columns go, which is how
figured out the numbers that I put in, but I didn't see any place t
specify the number for the Floor column. The attached file shows wha
happened when I tried to run my edited version of your code. Here i
the code that I used:
Sub ConcatStuff()
Dim rng As Range
Dim res As String
Dim i As Long
Dim j As Long
j = 1 'to nominate column E as the field to concatenate
For i = 80 To 93 'columns F, G & H - modify to suit (A = 69 so jus
work it out from there)
Set rng = Range("" & Chr(i) & "5:" & Chr(i) & "96") 'modify to suit (
& 100 are the row numbers, adjust as necessary)
For Each cell In rng
If cell.Value <> "AAA" And cell.Value <> "BBB" Then
If Len(res) < 1 Then
res = cell.Offset(0, -j).Value
Else
res = res & ", " & cell.Offset(0, -j).Value
End If
End If
Next
j = j + 1
Range("" & Chr(i) & "99").Value = res '101 is the row number that th
total will be populated into, adjust to suit
Next
End Sub
I'm sure this is related to my having little to no understanding o
VBA. Although I've seen enough of basic programming that I recogniz
things like For loops, so if you feel like explaining a little bi
about what each part of the code does I might be able to pick up on i
a little. Thanks again!
- Chris(not craig, although thats not a bad name either
Attachment filename: fixed tenant list.xls
Download attachment:
http://www.excelforum.com/attachment.php?postid=66841