Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50067

Ranges

$
0
0
Hello, I want to apply this function to a range that I do not have to individually highlight on individual sheets. Can someone edit my code to make the range be columns W:AF but only going down to the last row in which there is data? So you could check column A for instance, to see if there is data. And the last row that column A has data, the last row the function will go through on W:AF. I would also like it to work over every worksheet.


Function GetCells(MyRange As Range)
Dim Cell As Range
For Each Cell In MyRange
If Cell <> "" Then
GetCells = GetCells & Cell.Value & " "
End If
Next Cell
If GetCells <> "" Then GetCells = Left(GetCells, Len(GetCells) - 1)
End Function
Sub Concatenate()

End Sub

Viewing all articles
Browse latest Browse all 50067

Trending Articles