+ Reply to Thread
Results 1 to 3 of 3

Macro code working fine in excel 2013 but not in excel 2010.

  1. #1
    Registered User
    Join Date
    04-23-2014
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    17

    Macro code working fine in excel 2013 but not in excel 2010.

    Hi everyone,

    We have written the below macro code. It works fine in Excel 2013 but not for 2010. The code is for getting unique values.
    It does not show error for the macro, but it still does NOT process.
    Can u please guide us?


    Sub GetUniquecampaigns()
    Dim d As Object, c As Variant, i As Long, lr As Long
    Set d = CreateObject("Scripting.Dictionary")
    lr = Cells(Rows.Count, 1).End(xlUp).Row
    c = Range("A2:A" & lr)
    For i = 1 To UBound(c, 1)
    d(c(i, 1)) = 1
    Next i
    Sheets("sheet1").Range("A3").Resize(d.Count) = Application.Transpose(d.keys)

    End Sub

  2. #2
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: Macro code working fine in excel 2013 but not in excel 2010.

    sere,
    Please wrap your code with code tags as per forum's rule.
    It is difficult to see why the code is not working.
    Possible reasons.
    Since you are running it on active sheet, this sheet should have values in column A.
    If you only have a single sheet, that is sheet1, the code is overwriting the result on the same column A.
    Please attach a sample with the code to see what is going.

  3. #3
    Registered User
    Join Date
    04-23-2014
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: Macro code working fine in excel 2013 but not in excel 2010.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Working in Excel 2010 and not 2013
    By Jason*** in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2014, 11:28 AM
  2. [SOLVED] Excel 2010 to Excel 2013 Eroor? PivotTable, ListBox VBA not working.
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2014, 07:49 AM
  3. VBA charts work fine in excel 2013 but not in excel 2010
    By caabdul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2014, 08:05 AM
  4. code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9
    By ycg0311 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-25-2012, 11:56 AM
  5. Macros working fine on Windows (Excel 2010), but not on Mac (Excel 2011)
    By six6to8eight in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-29-2012, 11:12 PM

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