Hi!
Iv been working on VBA code to go through peoples staff number and transfer data form one spreadsheet to another while converting forumlas to values. This works fine at the minute but i would love to loop the below bit of code as currently for each staff member i have the code pasted in 30 times which means my SUB is rediculously big. Iv tried to add a loop to the code but as iv never used loops before i dont know what im doing and it doesnt work, any help would be much appreciated as this has been annoying me for ages!
[vba]Sheets("Sheet1").Select
If ActiveCell = 10057914 Then - 'this is the condition, if the active cell <> 10057914 then it should go onto the
'next staff number, but while it does have this value it should loop through the row copying and pasting them into sheet2
ActiveCell.EntireRow.Copy
ActiveCell.Offset(1, 0).Select
Sheets("Sheet2").Select
ActiveCell.Select
Selection.PasteSpecial Paste:=xlPasteValues
ActiveCell.Offset(1, 0).Select
End If
[/vba] Many Thanks!
Mark