Results 1 to 5 of 5

Code not working on Windows 8

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-21-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    110

    Code not working on Windows 8

    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!
    Last edited by Tejas.T; 05-11-2014 at 02:32 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA code Error after changed to windows 7, working fine in windows XP before
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-11-2014, 06:23 AM
  2. [SOLVED] Working in XP but not in Windows 7
    By Stonesteel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-02-2012, 10:42 AM
  3. Macros created in Windows XP not opening /working in Windows 7
    By Janane in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2012, 04:28 AM
  4. ocde working in one windows login but stopped working in another.
    By rama1209 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-02-2011, 08:38 AM
  5. Windows Encryption Code not working with Userform
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2006, 06:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1