Macro Error

  • Thread starter Thread starter Bob Vance
  • Start date Start date
B

Bob Vance

This macro copies from 2 cells A150, C152 then lists them on sheet "Two" in
A & B Column, but I am getting a error on the Union line, "Cant copy from
multiple cells"

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Address = "$C$152" Then
With Sheets("Two")
If .[A1] = "" Then
Union([A150], [C152]).Copy .[A1]
Else
Union([A150], [C152]).Copy .Range("A" & Rows.Count). _
End(xlUp)(2)
End If
[A1].Select
End With
End If
End Sub
--
Thanks in advance for your help....Bob Vance
..
..
..
..
 
Bob Vance said:
This macro copies from 2 cells A150, C152 then lists them on sheet "Two" in
A & B Column, but I am getting a error on the Union line, "Cant copy from
multiple cells" ....
Union([A150], [C152]).Copy .[A1]
....

I don't believe you can ever do this. Select two nonadjacent cells in any
worksheet and try to run the menu command Edit > Copy. Excel 2000 throws
errors when I try to do this interactively. It wouldn't be surprising if
Excel also didn't allow macros to do this.
 
Harlan Grove said:
Bob Vance said:
This macro copies from 2 cells A150, C152 then lists them on sheet "Two" in
A & B Column, but I am getting a error on the Union line, "Cant copy from
multiple cells" ...
Union([A150], [C152]).Copy .[A1]
...

I don't believe you can ever do this. Select two nonadjacent cells in any
worksheet and try to run the menu command Edit > Copy. Excel 2000 throws
errors when I try to do this interactively. It wouldn't be surprising if
Excel also didn't allow macros to do this.



I believe you can if the cells are either in the same column or the same
row. i.e.

Union([A150], [IV150]).Copy .[A1]

should work.


Regards,

Peo Sjoblom
 
Peo Sjoblom said:
I believe you can if the cells are either in the same column or the same
row. i.e.

Union([A150], [IV150]).Copy .[A1]

should work.

You're right. So much for orthogonality (again).
 
Great put them on the same Row, Thanks

--
Thanks in advance for your help....Bob Vance
..
..
..
..

Harlan Grove said:
Peo Sjoblom said:
I believe you can if the cells are either in the same column or the same
row. i.e.

Union([A150], [IV150]).Copy .[A1]

should work.

You're right. So much for orthogonality (again).
 
Back
Top