+ Reply to Thread
Results 1 to 6 of 6

Macro not working after update to excel 2013

  1. #1
    Registered User
    Join Date
    06-09-2014
    Posts
    4

    Unhappy Macro not working after update to excel 2013

    Hi everyone,

    This is my first post here and I usually do a research first and find my answers based on that but I couldn't find anything on this one. My company recently updated our excel to 2013 version and the macro that I've been using hasn't been working since then. I use the macro to convert our timesheets into an importable format. Basically what the macro does is take all the timesheets from a folder, open them, delete lines with "0" value and consolidate (copy paste) them into a new worksheet. All the other macros are working fine except for the last one which is the Copy and pasting of values for the first 900 lines.

    Sub copy_3()
    '
    'Copy paste value of 900 first lines
    Dim sourceRange As Range
    Dim destrange As Range
    Dim Lr As Long
    Application.ScreenUpdating = False
    Lr = LastRow(Dest.Sheets(2)) + 1 <- this was the first line that I was having trouble with but figured it out
    Set sourceRange = Sheets(2).Rows("1:900")
    Set destrange = Dest.Sheets(2).Rows(Lr) <-Then this is where I got stuck
    sourceRange.Copy
    destrange.PasteSpecial xlPasteValues, , False, False
    Application.CutCopyMode = False
    Application.ScreenUpdating = True



    End Sub

    I've attached a sample of our timesheet and the macro that I'm using. If this doesn't work I'm thinking of just merging all the timesheets into one worksheet and manually delete the lines I don't need.

    Thanks everyone!!
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro not working after update to excel 2013

    Are you running that code via ouvrirFichiers or on it's own?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    06-09-2014
    Posts
    4

    Re: Macro not working after update to excel 2013

    I'm running it via "ouvrirFichiers" Thanks!

  4. #4
    Registered User
    Join Date
    06-09-2014
    Posts
    4

    Re: Macro not working after update to excel 2013

    I actually tried it again and I thought I had it figured out and "Lr = LastRow(Dest.Sheets(2)) + 1" is still causing an error. :-S

  5. #5
    Registered User
    Join Date
    06-09-2014
    Posts
    4

    Re: Macro not working after update to excel 2013

    Hi Everyone,

    I didn't get to solve the issue but what I did was I asked our IT to install excel 2003 to my computer and it works again.

    Thanks!

  6. #6
    Forum Contributor
    Join Date
    04-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    198

    Re: Macro not working after update to excel 2013

    I think you can fix this by activating the dest workbook before you do the last row... so instead of dest.lastrow(2) do the activate dest2 as a workbook then do the lastrow sheet(2) this should prevent any of the errors your are getting in 2013... just my opinion

+ 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. Replies: 3
    Last Post: 07-20-2014, 11:46 AM
  2. Excel 2013 - Macro to update new sheet
    By quabba in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-23-2014, 11:53 AM
  3. Excel 2007 Macro not working in Excel 2013
    By amalejko in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-01-2014, 11:24 AM
  4. Macro not working in excel 2013
    By kbka in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2014, 06:58 AM
  5. 2010 macro not working in 2013 via button
    By PaulieNZ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-01-2013, 01:27 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