Hi All,
Can anybody please make the below code Windows-8 compatible as well?
The code works fine on Window-7.
Sub Copy_To_Clipboard()
Dim mLastRow&, mRow&
Dim NumberStr$, CopyStr$
Dim oClipBoard As New DataObject
With CrossReferenceSheet
mLastRow = .Cells(Rows.Count, "E").End(xlUp).Row
If mLastRow < 5 Then
MsgBox "Nothing to copy!", vbCritical
Exit Sub
End If
For mRow = 5 To mLastRow
NumberStr = .Cells(mRow, "E").Value & .Cells(mRow, "F").Value & .Cells(mRow, "G").Value & .Cells(mRow, "H").Value
CopyStr = CopyStr & NumberStr & ","
Next
If Len(CopyStr) > 0 Then
CopyStr = Left(CopyStr, Len(CopyStr) - 1)
End If
End With
oClipBoard.SetText CopyStr
oClipBoard.PutInClipboard
Set oClipBoard = Nothing
MsgBox "Numbers Copied to Clipboard", vbInformation
End Sub
Many Thanks in Advance!
Bookmarks