Hi Mark,
Just had another play with it and actually did manage to get the new bit of code working.
[vba]
If lngRecoverableCol > 0 Then
For sRow = 2 To lngLastRow
Select Case .Cells(sRow, lngRecoverableCol).Value
Case 0
Case Is > 0
dRow = dRow + 1
DestSheet.Cells(dRow, "C").Value = .Cells(sRow, "A").Value
DestSheet.Cells(dRow, "G").Value = "Recoverable"
DestSheet.Cells(dRow, "H").Value = .Cells(sRow, lngRecoverableCol + 1).Value
DestSheet.Cells(dRow, "D").Value = .Cells(sRow, lngRecoverableCol).Value
Case Is < 0
dRow = dRow + 1
DestSheet.Cells(dRow, "C").Value = .Cells(sRow, "A").Value
DestSheet.Cells(dRow, "G").Value = "Recoverable"
DestSheet.Cells(dRow, "H").Value = .Cells(sRow, lngRecoverableCol + 1).Value
DestSheet.Cells(dRow, "E").Value = .Cells(sRow, lngRecoverableCol).Value
End Select
Next
End If
[/vba]
So that's great. I am almost there with this now. I also took your advice and used this [vba]Dim DestSheet As Worksheet
Dim SourceSheet As Worksheet
Dim lngSalaryColumn As Long
Dim lngHumptyCol As Long
Dim lngTestCol As Long
Dim lngLastRow As Long
Dim sRow As Long
Dim dRow As Long
Dim sCount As Long [/vba]
The worry I have I will have easily 90 Dim rows. With this volume I suspect I will run out of line space in the macro and have to then do a second macro. Which I am loathe to do. I'd like to keep it as 1 long macro. What is the easiest way to do this?
The attached spreadsheet shows it works!Attachment 680
1 final thing I was wondering. Is there any way of modifying it so that instead of copying the cell value it pus it a formula pointing to that cell as shown in sheet2?
Sorry in advance for my poor way of explaining things!