Results 1 to 3 of 3

Macro Project - Consistently breaks

Threaded View

dkatz Macro Project - Consistently... 02-23-2015, 11:40 AM
6StringJazzer Re: Macro Project -... 02-23-2015, 02:33 PM
dkatz Re: Macro Project -... 02-23-2015, 04:02 PM
  1. #1
    Registered User
    Join Date
    02-18-2015
    Location
    Hollywood, FL
    MS-Off Ver
    2010
    Posts
    2

    Macro Project - Consistently breaks

    Greetings all,

    I have a project that I am working on that involves the creation of several macros within one workbook. The goal is to provide a central workbook that can be accessed by any staff member and based upon the source file selected for a data matching task, the associated macro can be applied. The purpose of the macros is to provide preparatory formatting, move the contents of Sheet1 to Sheet2 and rename both sheets.

    I was able to create the macros using the Personal.xlsb method and all seemed fine when I ran the first macro. As soon as I either "save" or close and re-open, the workbook breaks with any of several errors. I have received "400 Visual Basic" errors that say nothing else but what is in quotes, another Microsoft Visual Basic error of "Run-time error '9': Subscript out of range". Below is the macro that is resulting in the run-time error 9 so if anyone can shed some light on whether or not I am going about this the right way or perhaps a better solution is available I would be very appreciative. FYI, the macro below pertains to a file containing 7881 rows.

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    Sub Lanyon_Pre()
    '
    ' Lanyon_Pre Macro
    '
    
    '
        Columns("B:H").Select
        Selection.Delete Shift:=xlToLeft
        ActiveWindow.SmallScroll ToRight:=3
        Columns("H:M").Select
        Selection.Delete Shift:=xlToLeft
        ActiveWindow.LargeScroll ToRight:=-1
        ActiveWindow.SmallScroll ToRight:=2
        Sheets.Add After:=Sheets(Sheets.Count)
        Sheets("MMT_PropertyList").Select
        Cells.Select
        Range("C1").Activate
        Selection.Cut
        Sheets("Sheet1").Select
        ActiveSheet.Paste
        Sheets("MMT_PropertyList").Select
        Sheets("MMT_PropertyList").Name = "ICE"
        Sheets("Sheet1").Select
        Sheets("Sheet1").Name = "Lanyon"
        Range("B21").Select
    End Sub
    Last edited by 6StringJazzer; 02-23-2015 at 01:44 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Line breaks in a string not working consistently.
    By Arkadi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-11-2014, 01:27 PM
  2. Clear all page breaks, then insert new breaks at change in data
    By Alex0929 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2014, 03:12 PM
  3. Macro doesn't work consistently
    By mrbill11 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-14-2012, 04:35 PM
  4. Hard page breaks being replaced by soft breaks in the wrong place
    By JDavies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-14-2008, 10:28 AM
  5. Hard breaks in text to soft breaks in Excel
    By tbailey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2005, 12:05 AM

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