+ Reply to Thread
Results 1 to 3 of 3

Help to update code from 2010 to 2013

Hybrid View

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel H&B 2013
    Posts
    14

    Help to update code from 2010 to 2013

    I was and still am using this code from a 2010 workbook but I have made a new form using Excel H&B 2013 and code gets stuck.
    Code gets stuck on .Pattern = xlNone
    Any help would be appreciated

    Sub SaveAs()
    '
    ' SaveAs Macro
    '
    
    '
        Sheets("FORM").Select
        Sheets("FORM").Copy
        ActiveSheet.Shapes.Range(Array("Button 1")).Select
        Selection.Delete
        ActiveSheet.Shapes.Range(Array("Button 4")).Select
        Selection.Delete
        ActiveSheet.Shapes.Range(Array("Button 3")).Select
        Selection.Delete
        ActiveSheet.Shapes.Range(Array("Button 2")).Select
        Selection.Delete
        ActiveSheet.Shapes.Range(Array("Button 5")).Select
        Selection.Delete
        Range("C2:O50").Select
        With Selection.Interior
            .Pattern = xlNone
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
        Range("D2").Select
        Selection.Copy
        Range("D5:M42").Select
        Range("E5").Activate
        Selection.PasteSpecial Paste:=xlPasteValidation, Operation:=xlNone, _
            SkipBlanks:=False, Transpose:=False
        Range("J3:L3").Select
        Application.Dialogs(xlDialogSaveAs).Show
        End Sub

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

    Re: Help to update code from 2010 to 2013

    Does this work?
    Sub SaveAs()
    '
    ' SaveAs Macro
    '
    
    '
    
        Sheets("FORM").Copy
        
        With ActiveSheet
        
            .Shapes.Range(Array("Button 1")).Delete
            .Shapes.Range(Array("Button 4")).Delete
            .Shapes.Range(Array("Button 3")).Delete
            .Shapes.Range(Array("Button 2")).Delete
            .Shapes.Range(Array("Button 5")).Delete
            
            With .Range("C2:O50")
                With .Interior
                    .Pattern = xlNone
                    .TintAndShade = 0
                    .PatternTintAndShade = 0
                End With
            End With
    
            .Range("D2").Copy
            
            .Range("D5:M42").PasteSpecial Paste:=xlPasteValidation
            
            Application.Goto Range("J3:L3")
            
        End With
    
        Application.Dialogs(xlDialogSaveAs).Show
        
    End Sub
    By the way, might not be a good idea using SaveAs as the name of the sub, SaveAs is already the name of a method in VBA.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-28-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel H&B 2013
    Posts
    14

    Re: Help to update code from 2010 to 2013

    Thanks Norie all good
    Thanks for the advice I will rename it

+ 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. Macro problem, update 2010 => 2013
    By Alucardo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2016, 10:39 AM
  2. VBA code working in Outlook 2010 but not in 2013
    By fiffers in forum Outlook Programming / VBA / Macros
    Replies: 5
    Last Post: 10-01-2015, 08:52 AM
  3. VBA code working in Outlook 2010 but not in 2013
    By fiffers in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 09-22-2015, 05:16 AM
  4. Replies: 8
    Last Post: 03-08-2015, 10:02 AM
  5. Code works for outlook 2010 but not 2013
    By Legend Rubber in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2015, 05:00 PM
  6. Macro code working fine in excel 2013 but not in excel 2010.
    By sere in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-10-2014, 02:23 AM
  7. VBA code for Microsoft 2010 / 2013
    By syed82 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-09-2014, 12:56 AM

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