LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Excel 2003 error message!

Hello,

My workbook has 100 worksheets and I'm using the code below to makes to
all of them:

Sub EquipListFFPageSort()
'
Dim sh As Worksheet
Application.ScreenUpdating = False

For Each sh In ActiveWorkbook.Worksheets
sh.Select
'Your format code
Range("A1:C65536").Select
Application.Run
"EQUIP_LIST_Macros.xls!DeleteBlankSpacesOnTheLeftA ndRight"
Range("C4:C65536").Select
Selection.Copy
Range("D4").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("D65530").Select
ActiveCell.FormulaR1C1 = "ABC"
Range("D65531").Select
ActiveCell.FormulaR1C1 = "DEF"
Range("D65532").Select
ActiveCell.FormulaR1C1 = "GHI"
Range("D65533").Select
ActiveCell.FormulaR1C1 = "JKL"
Range("D4:D65536").Select
Application.Run "EQUIP_LIST_Macros.xls!RemoveAlphas"
Range("A4:D65536").Select
Selection.Sort Key1:=Range("B4"), Order1:=xlAscending,
Key2:=Range("D4") _
, Order2:=xlAscending, Key3:=Range("C4"), Order3:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal,
DataOption3:= _
xlSortNormal
Columns("D:D").Select
Selection.ClearContents
Range("A1").Select

Application.ScreenUpdating = True
Next sh
End Sub

But when I run this code it goes through about 15 worksheets and gives
me these two error messages:

Microsoft Excel Error Message
Excel cannot complete task with available resources. Choose less data
or close other applications.

After I close this error message it brings up this error message:

Microsoft Visual Basic Error Message
Run-time error '1004':
Paste method of Worksheet class failed

Then I click debug and ActiveSheet.Paste is highlighted in my code.

How can I get this code to run without causing any errors?

Thank you for your help in advance,
jfcby

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 accepting error message in macro BJ&theBear Excel Discussion (Misc queries) 2 May 25th 10 06:21 PM
Vlookup Error Message - Excel 2003 Kim Excel Discussion (Misc queries) 9 August 24th 09 05:50 PM
Error message adaytum.xla when closing workbook in Excel 2003 Laura2008 Excel Discussion (Misc queries) 1 November 5th 08 06:36 PM
Excel 2003 Error Message Marilyn Excel Discussion (Misc queries) 0 December 11th 06 05:22 PM
Document Not Saved Error Message - Excel 2003 glomonkey Excel Discussion (Misc queries) 1 January 25th 06 04:02 PM


All times are GMT +1. The time now is 09:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"