Don30
09-29-03, 13:26
| I am new to programming in Excel. My problem is, I am coding a macro to joincells. The problem is that the row can happen anywhere throughout the report. I was able to use the find function to find the begining of row and able to do what I need, but can't deterine where to break out of the loop. Here is the code I'm using: Public Function NewFind() Dim currRow As Integer Dim currcell As String Dim y As String Dim r As String With Worksheets(1).Range("a1:a500") Set C = .Find("DATE", LookIn:=xlValues) currRow = C.row currRow = currRow + 2 Do currcell = "G" & currRow y = "I" & currRow r = currcell & ":" & y JoinCells Range(r), AndCenter:=False currRow = currRow + 1 Loop While Worksheets(1).Range("A:" & currRow) Is Nothing End With End Function Any help would greatly appreciated. If there is a better way to code this whole thing, that would be helpful too. |