+ Reply to Thread
Results 1 to 2 of 2

Move worksheet method failed

  1. #1
    Registered User
    Join Date
    05-23-2013
    Location
    cambridge
    MS-Off Ver
    Excel 2003
    Posts
    12

    Move worksheet method failed

    I am getting this error Move Method Of Worksheet Class Failed with the code below. Can anyone help, thanks a lot

    [Code]
    Sub MoveThem1()

    Dim ws As Worksheet, ss As Worksheet, FolderName As String, Wb As Workbook
    Application.ScreenUpdating = False
    FolderName = ThisWorkbook.Path
    Dim C As Range
    Set thisWb = ThisWorkbook
    For Each ws In thisWb.Worksheets
    If ws.Name <> "Macro" And ws.Name <> "REMS_2014_0324 " Then
    If Wb Is Nothing Then
    ws.Activate
    ActiveSheet.Move
    Set Wb = ActiveWorkbook

    Else

    ws.Move After:=ss

    End If

    Set ss = ActiveSheet
    End If

    Next ws
    Set Wb = ThisWorkbook
    ThisWorkbook.Activate

    Application.DisplayAlerts = False

    Wb.SaveAs Filename:=Sheets("Macro").Range("E20") & ".xlsx"

    w.Close
    Application.DisplayAlerts = True


    End Sub

    [\Code]

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Move worksheet method failed

    What are you trying to get done with this code?

    the ss variable is not set yet when you try to move after it.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

+ 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. paste method of worksheet failed
    By Theodjinn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-26-2008, 07:36 AM
  2. Run-time error '1004' Move Method of Chart class failed
    By skyreaver88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-11-2007, 05:17 PM
  3. [SOLVED] "Move Method of Worksheet Class failed"
    By azurmendi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-03-2005, 11:10 AM
  4. Paste method of worksheet class failed
    By kavisara in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2005, 01:44 PM
  5. Copy Method of WorkSheet Class Failed!
    By Donna in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-11-2005, 05:06 PM

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