Selecting a range relative to ActiveCell, copy it to second Workshett within Workbook

M

Monta Zengerle

This works through "ActiveCell.Offset(0, -8).Activate" but then doesn't.

Any help appreciated.


Sub SortforMember()

Worksheets("Sheet1").Activate
Worksheets("Sheet1").Range("I1").Select
Worksheets("Sheet2").Activate
Worksheets("Sheet2").Range("a2").Select


Do Until Cell = "Null"

Sheet1.Activate
ActiveCell.Offset(1, 0).Activate

If ActiveCell = "Yes" Then


ActiveCell.Offset(0, -8).Activate
Range(Cells(1, 1), End(x1ToRight)).Copy _
destination:=Worksheets("Sheet2").Range(Cells(0, 0), Cells(0, 9))



Sheet2.Activate
ActiveCell.Offset(1, 0).Activate

End If

If ActiveCell = "No" Then
Sheet2.Activate
ActiveCell.Offset(0, 0).Activate
End If


Loop


End Sub
 
D

Dave Peterson

x1ToRight is xltoright (you have a 1 (one) instead of an L (ell).

But you have some other problems, too.

You may want to describe what you're doing. There are better ways than
depending on .selects and .activates and the activecell.
 

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