View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default how to give values to non-continguous cells simultaneously

try this

Option Explicit
Dim cell As Range
Sub copy_column()
With Range("A:a")
Debug.Print Selection.Value
Selection.Offset(0, 1).Value = Selection.Value
End With

End Sub

--


Gary


"xiang" wrote in
message ...

thanks a lot, Gary

it works when row 2 and row 5 are empty. How about if there are some
values in
row 2 and row 5, and I only want to give selected values in columnA to
column B at corresponding positions. In other words, I don't want to
give non-selected values in column A to Column B.

is there any non-loop way to do this or simply not doable?

thanks for your response


--
xiang
------------------------------------------------------------------------
xiang's Profile:
http://www.excelforum.com/member.php...o&userid=29489
View this thread: http://www.excelforum.com/showthread...hreadid=492594