+ Reply to Thread
Results 1 to 3 of 3

Compile Error - Selection.Insert Shift:=x1Down when used in Office 365

  1. #1
    Registered User
    Join Date
    06-01-2014
    Posts
    3

    Compile Error - Selection.Insert Shift:=x1Down when used in Office 365

    Hi Pros,

    I have written the below code (part of much longer macro) several months ago and used it many time in Excel 2013. However, I now need to run this code on a PC that is running Office 365 and I get a compile error at line 3. Does anyone have any ideas please??


    For k = 1 To N
    Rows(ActiveCell.Row).Offset(1).Select
    Selection.Insert Shift:=x1Down, CopyOrigin:=xlFormatFromLeftOrAbove
    J = J + 1
    ActiveCell.Offset(0, 4).Select

    ActiveCell.Formula = "=INDEX('[Website Item Data File.xlsx]PIVOT2'!$B:$B,Offset(" & ActiveCell.Address & "," & (-k) & ",12)+" & (4 + k) & ")"
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Formula = "=INDEX('[Website Item Data File.xlsx]PIVOT2'!$C:$C,Offset(" & ActiveCell.Address & "," & (-k) & ",11)+" & (4 + k) & ")"

    Next k

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Compile Error - Selection.Insert Shift:=x1Down when used in Office 365


    Hi !

    Classic typo x1Down instead of xlDown !

  3. #3
    Registered User
    Join Date
    06-01-2014
    Posts
    3

    Re: Compile Error - Selection.Insert Shift:=x1Down when used in Office 365

    Perfect! Thanks very much for the help.

+ 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. “Selection.Insert Shift:=xlDown” gets Run-time error '1004'
    By watsonea4 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-02-2023, 07:07 AM
  2. Selection Autofill combined with End(x1Down)
    By LewisLonsdale in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2015, 10:56 AM
  3. Replies: 11
    Last Post: 07-18-2012, 02:32 PM
  4. Help - Insert method of Range class failed - Selection.Insert Shift:=xlToRight
    By sandy@excelforum in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-04-2012, 11:14 AM
  5. selection.end(x1Down) feature
    By johndough185 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-10-2007, 09:40 AM
  6. Macro to copy a row, then insert shift:=x1Down
    By Lost in Alabama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2006, 08:00 AM
  7. Help with Compile Error in Excel Office 2003
    By Julian Cann in forum Excel General
    Replies: 2
    Last Post: 04-03-2005, 10:06 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