R
R Dunn
Hi all,
I'm trying to write a macro that looks at the entry in A1, and if this is
11, then it copies the entry in B1 into another sheet.
But then it loops through all the rows with data in them, so I can't just
use "A1 and "B1".
At the moment, I'm using "MyCell", as per the code below. But what I'd like
to do is change the line
Range("B4").Select
to something like
Range(Cells(MyCell.Row, MyCell.Column)).Select
I know this isn't the right way to reference it, anyone know how?
NB: I'm using Excel 2003, so I don't have access to the OFFSET command.
Thanks in advance!
Rebecca
For Each MyCell In Selection
If MyCell.Value Like 11 Then
' Change to follow cells properly
Range("B4").Select
Selection.Copy
Sheets("11 out").Select
ActiveSheet.Paste
End If
Next
End Sub
I'm trying to write a macro that looks at the entry in A1, and if this is
11, then it copies the entry in B1 into another sheet.
But then it loops through all the rows with data in them, so I can't just
use "A1 and "B1".
At the moment, I'm using "MyCell", as per the code below. But what I'd like
to do is change the line
Range("B4").Select
to something like
Range(Cells(MyCell.Row, MyCell.Column)).Select
I know this isn't the right way to reference it, anyone know how?
NB: I'm using Excel 2003, so I don't have access to the OFFSET command.
Thanks in advance!
Rebecca
For Each MyCell In Selection
If MyCell.Value Like 11 Then
' Change to follow cells properly
Range("B4").Select
Selection.Copy
Sheets("11 out").Select
ActiveSheet.Paste
End If
Next
End Sub