+ Reply to Thread
Results 1 to 2 of 2

Problem renaming worksheets

  1. #1
    Registered User
    Join Date
    04-18-2006
    Posts
    34

    Problem renaming worksheets

    After countlessly deleting empty rows with my mouse, I proceeded to insert a macro inside all files which I need to empty rows from. The formula is as follows:

    Sub DeleteEmptyRows()

    Dim LastRow As Long, r As Long

    LastRow = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count
    Application.ScreenUpdating = False

    For r = LastRow To 1 Step -1
    If Application.CountA(Rows(r)) = 0 Then Rows(r).Delete
    Next r

    Application.ScreenUpdating = True

    End Sub
    For two days, I've used this formula without a problem. However, today, when I renamed my worksheets, excel keeps adding an ".xls]" at the beginning of the worksheet's name (note: not the filename). Is there any reason or way that the macros would be interfering with the software? If so, how can I fix it? or was it that I accidentally enabled some random functionality? something else? Please help!

    Note: I only have this problem in workbooks where I have utilized the macro.

    P.S.: I am using Excel 2000, but any general guidelines for any other year would be helpful and much appreciated.

  2. #2
    Dave Peterson
    Guest

    Re: Problem renaming worksheets

    Close excel.
    Open windows explorer.
    Go to the folder with that file.
    Rename it and remove any [ and ] characters.



    ArenaNinja wrote:
    >
    > After countlessly deleting empty rows with my mouse, I proceeded to
    > insert a macro inside all files which I need to empty rows from. The
    > formula is as follows:
    >
    > > Sub DeleteEmptyRows()
    > >
    > > Dim LastRow As Long, r As Long
    > >
    > > LastRow = ActiveSheet.UsedRange.Row - 1 +
    > > ActiveSheet.UsedRange.Rows.Count
    > > Application.ScreenUpdating = False
    > >
    > > For r = LastRow To 1 Step -1
    > > If Application.CountA(Rows(r)) = 0 Then Rows(r).Delete
    > > Next r
    > >
    > > Application.ScreenUpdating = True
    > >
    > > End Sub

    >
    > For two days, I've used this formula without a problem. However, today,
    > when I renamed my worksheets, excel keeps adding an ".xls]" at the
    > beginning of the worksheet's name (note: not the filename). Is there
    > any reason or way that the macros would be interfering with the
    > software? If so, how can I fix it? or was it that I accidentally
    > enabled some random functionality? something else? Please help!
    >
    > Note: I only have this problem in workbooks where I have utilized the
    > macro.
    >
    > P.S.: I am using Excel 2000, but any general guidelines for any other
    > year would be helpful and much appreciated.
    >
    > --
    > ArenaNinja
    > ------------------------------------------------------------------------
    > ArenaNinja's Profile: http://www.excelforum.com/member.php...o&userid=33624
    > View this thread: http://www.excelforum.com/showthread...hreadid=533979


    --

    Dave Peterson

+ 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