Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default 400 Error during Macro

Hello, I am running a macro that removes cells with nothing in them, sorts
them, and then moves them to another worksheet. here it is:

Public Sub DeleteStuff()
Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Delete
Range("D1:F9").Select
Selection.Sort Key1:=Range("D1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Sheets("PROPOSAL").Select
ActiveCell.FormulaR1C1 = "=MidStep!R[-19]C[3]"
Range("C21").Select
Selection.AutoFill Destination:=Range("C21:C68"), Type:=xlFillDefault
Range("C21:C68").Select
ActiveWindow.SmallScroll Down:=-42
End Sub



It deletes and sorts alright, but when it goes to copy to the other
worksheet, a Microsoft Visual Basic error box comes up, and it only says 400
inside. Any ideas about what this is? i couldnt find anything here pertaining
to it. Thanks for any help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default 400 Error during Macro

but when it goes to copy to the other worksheet

But there is no Copy in your code.

Re this code:
Sheets("PROPOSAL").Select
ActiveCell.FormulaR1C1 = "=MidStep!R[-19]C[3]"

This isn't so good because it depends on the right cell having been
preselected on sheet Proposal. Better to be specific:

Range("B20").FormulaR1C1 = "=MidStep!R[-19]C[3]"

--
Jim
"DFrank" wrote in message
...
| Hello, I am running a macro that removes cells with nothing in them, sorts
| them, and then moves them to another worksheet. here it is:
|
| Public Sub DeleteStuff()
| Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Delete
| Range("D1:F9").Select
| Selection.Sort Key1:=Range("D1"), Order1:=xlAscending, Header:=xlGuess,
_
| OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
| DataOption1:=xlSortNormal
|
| Sheets("PROPOSAL").Select
| ActiveCell.FormulaR1C1 = "=MidStep!R[-19]C[3]"
| Range("C21").Select
| Selection.AutoFill Destination:=Range("C21:C68"), Type:=xlFillDefault
| Range("C21:C68").Select
| ActiveWindow.SmallScroll Down:=-42
| End Sub
|
|
|
| It deletes and sorts alright, but when it goes to copy to the other
| worksheet, a Microsoft Visual Basic error box comes up, and it only says
400
| inside. Any ideas about what this is? i couldnt find anything here
pertaining
| to it. Thanks for any help.


Reply
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
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Macro error : Application-defined or object-defined error Joe Excel Discussion (Misc queries) 3 January 27th 06 02:32 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
run macro error, please help [email protected] Excel Discussion (Misc queries) 0 February 8th 05 03:52 AM


All times are GMT +1. The time now is 03:17 PM.

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"