Hi all members,
Using this macro, when you select several cells (using ctrl+click) , for example cell B12 + C13 + D16 (then run the macro), it will will copy values of cell I12, I13, I16. In otherword, no matter which cells you selected, it will always copy cell of column "I" (under that same row the cell was selected)
(originally from a guy call Karan and modified by Alphafrog in this thread)
Sub CopySelectedCells()
Dim str As String, rangeRow As Range
For Each rangeRow In Selection.Rows
str = str & Cells(rangeRow.Row, "I").Value
str = str & ","
Next
str = Left(str, Len(str) - 1) & vbCrLf
With New MSForms.DataObject 'Early binding (requires reference to MSForms 2.0 Obect library)
'Late binding (does not require reference)
'With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText str
.PutInClipboard
End With
End Sub
Now the problem is, sometime the selected cells contain same values (duplicate)
Can someone help modify this macro so that it will copy and remove duplicates value, if any. (the remove process should be done before pasting the data into other media, such as notepad)
p.s: my knowledge in VB is way below basic
Bookmarks