+ Reply to Thread
Results 1 to 2 of 2

Help with VB Code

  1. #1
    Registered User
    Join Date
    06-04-2011
    Location
    San Francisco, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Help with VB Code

    Hi,


    Can someone help me out with the code below. This code runs on a Mac with Excel 2011. After the code runs without error, when attempting to perform a Save As Excel crashes.


    Any help is greatly appreciated!



    Please Login or Register  to view this content.
    Application.ScreenUpdating = False

    Dim FN As String

    Filename = Range("Path")
    'Filename = Application.GetSaveAsFilename(filefilter:="Excel Files (*.xlsm),*.xlsm")
    FN = Right(Filename, 19)

    On Error GoTo Err1

    MsgBox "You selected " & Filename
    If Filename = False Then
    Exit Sub
    Else
    Workbooks.Open Filename:=Filename

    End If

    Workbooks(FN).Sheets("By Week").Activate
    Range("A7").CurrentRegion.Copy
    ThisWorkbook.Worksheets("KPI Report").Range("A6").PasteSpecial

    Workbooks(FN).Sheets("Survey").Activate
    Range("A4").CurrentRegion.Copy
    ThisWorkbook.Worksheets("Sheet1").Range("A3").PasteSpecial

    ThisWorkbook.Worksheets("Charts").Activate
    Range("A60:A64").Copy
    Range("E60").PasteSpecial Paste:=xlPasteValues

    Application.CutCopyMode = False

    Workbooks(FN).Close SaveChanges = False

    Sheets("Charts").Activate

    Application.ScreenUpdating = True

    Exit Sub

    Err1:
    MsgBox "File Not Found! Please check File Path and File Name and try again."
    End Sub
    Please Login or Register  to view this content.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Help with VB Code

    Your post breaks two forum rules

    Thread Title
    Use of Code Tags
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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