Problem renaming worksheets

A

ArenaNinja

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.
 
D

Dave Peterson

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


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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top