Hello.
I've asked this in the Microsoft Office forum, but it's getting awfully VBA based, so I thought I'd transfer it here.
I have a table that looks something like :
A B C D E F
1 New ................ 18/06/02
2 Closed .............. 15/05/03
3 Open ................ 19/05/03
4 New ................. 12/06/03
5 New ................. 08/06/03
I need to write some VBA that will look across this data and return a string of the A column (ID numbers) separated by commas, where the status in B is New and the Date in F is more than 5 days ago. In the above extract, I'd get
as the answer.
I've been given code to run a macro to concatenate the strings, here it is :
Anyone know how to do the rest? I'm planning to set up a button to run these macros from a different workbook. I've got the skeleton code set up, but it needs finetuning.
Hope you can help
David
I've asked this in the Microsoft Office forum, but it's getting awfully VBA based, so I thought I'd transfer it here.
I have a table that looks something like :
A B C D E F
1 New ................ 18/06/02
2 Closed .............. 15/05/03
3 Open ................ 19/05/03
4 New ................. 12/06/03
5 New ................. 08/06/03
I need to write some VBA that will look across this data and return a string of the A column (ID numbers) separated by commas, where the status in B is New and the Date in F is more than 5 days ago. In the above extract, I'd get
Code:
1,5
I've been given code to run a macro to concatenate the strings, here it is :
Code:
Sub Concat()
Dim LastRw As Long
Dim Rng As Range
Dim str As String
str = Range("A1").Value
LastRw = Cells(Rows.Count, "A").End(xlUp).Row
Set Rng = Range(Cells(1, "A"), Cells(LastRw, "A"))
For x = 1 To Rng.Rows.Count
str = str & "," & Rng.Rows(x).Value
Next x
Range("B1") = str
End Sub
Anyone know how to do the rest? I'm planning to set up a button to run these macros from a different workbook. I've got the skeleton code set up, but it needs finetuning.
Hope you can help
David