checking and copying cells

G

Guest

the sub below does not work. when it goes to the saved records worksheet it
does not go through the records.

Worksheets("Saved Records").Activate
For Each cell In Worksheets("Saved Records").Range("A2:A102")
If cell.Text = name Then
ActiveCell.EntireRow.Select
Selection.Copy
Worksheets("Temporary Record").Activate
Worksheets("Temporary Record").Range("B1:B223").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True
'Worksheets("Saved Records").Activate
'ActiveCell.EntireRow.Delete
Exit For
End If
Next cell
 
G

Guest

Sub tst()

Worksheets("Saved Records").Activate
For Each cell In Worksheets("Saved Records").Range("A2:A102")
If cell.Value = "name" Then
cell.EntireRow.Select
Selection.Copy
Worksheets("Temporary Record").Activate
Worksheets("Temporary Record").Range("B1:B223").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True
'Worksheets("Saved Records").Activate
'cell.EntireRow.Delete
''''''''''Exit For
End If
Next

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top