Hi everybody,
I am currently using the following code to save fields to another worksheet. I want to limit it to only do the saving when a certain cell on the source worksheet has a specific value. How can I do this?
Thanks
Jo
Win XP Excel 2007
I am currently using the following code to save fields to another worksheet. I want to limit it to only do the saving when a certain cell on the source worksheet has a specific value. How can I do this?
Code:
Set Src = Worksheets("Input")
Set Dest = Worksheets("PP")
Dest.Select
Range("A2").Select
Selection.End(xlDown).Select
NR = Selection.Row + 1
Dest.Cells(NR, 1).Value = Src.Cells(8, 5).Value 'Date
Dest.Cells(NR, 2).Value = Src.Cells(21, 6).Value 'Stime
Dest.Cells(NR, 3).Value = Src.Cells(21, 7).Value 'Etime
Dest.Cells(NR, 4).Value = Src.Cells(21, 8).Value 'Hours
Dest.Cells(NR, 5).Value = Src.Cells(14, 5).Value 'Tariff
Dest.Cells(NR, 6).Value = Src.Cells(14, 6).Value 'Total
Src.Cells(10, 5).ClearContents
Src.Cells(14, 5).ClearContents
Src.Range("e21:e30").ClearContents
Dest.Select
Thanks
Jo
Win XP Excel 2007