Resubmitted my cell evaluation question from earlier, forgot the macro or formula
Posted by Jay on February 08, 2002 1:50 PM
Hi
I am trying to look at B2 and if any information is there or number or data then move over to the right one cell and up one cell and copy active cell and move back down one cell and paste move over one cell and up and copy and down and paste. When I copy and paste I want the A2 in formula to change to A3 or A4 or A5 etc. as I continue to copy and move down in my worksheet. If I copy by hand with the mouse and paste down the A2 will change to A3 and so forth. What can I do to make it change. Hope you understand all if this. Thanks Jay Private
This is formula I am doing. The A2 in front of [Book21.xls] is what I am talking about
Sub CommandButton1_Click()
Worksheets("Sheet2").Activate
ActiveCell = UserForm1.ComboBox1.Value
If ("B2") = "=INDEX([Book21.xls]Sheet3!$V$2:$X$4,MATCH(A2,[Book21.xls]Sheet3!$V$2:$V$4,FALSE),2)" Then
ActiveCell.Offset(-1, 1).Activate
Selection.Copy
ActiveCell.Offset(1, 0).Activate
ActiveSheet.Paste
ActiveCell.Offset(-1, 1).Activate
Selection.Copy
ActiveCell.Offset(1, 0).Activate
ActiveSheet.Paste
ActiveCell.Offset(1, -2).Activate
Else
ActiveCell.Offset(0, 1).Activate
ActiveCell = "=INDEX([Book21.xls]Sheet3!$V$2:$X$4,MATCH(A2,[Book21.xls]Sheet3!$V$2:$V$4,FALSE),2)"
ActiveCell.Offset(0, 1).Activate
ActiveCell = "=INDEX([Book21.xls]Sheet3!$V$2:$X$4,MATCH(A2,[Book21.xls]Sheet3!$V$2:$V$4,FALSE),3)"
ActiveCell.Offset(1, -2).Activate
UserForm1.Hide
End If
End Sub