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: 28
Default Macros and merged cells

im trying to run a macro that combines a bunch of other macros. i have one
macro that sorts a list to prepare it for a vlookup. when running the macro
seperately, it works fine. when trying to run the macro through another
macro, i get an error.

here is my first macro:

Range("A1:B500").Select
Range("B500").Activate
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveWindow.LargeScroll Down:=-1
Range("B475").Select
ActiveWindow.LargeScroll Down:=-1
Range("B450").Select
ActiveWindow.LargeScroll Down:=-1
Range("B425").Select
ActiveWindow.LargeScroll Down:=-1
Range("B400").Select
ActiveWindow.LargeScroll Down:=-1
Range("B375").Select
ActiveWindow.LargeScroll Down:=-1
Range("B350").Select
ActiveWindow.LargeScroll Down:=-1
Range("B325").Select
ActiveWindow.LargeScroll Down:=-1
Range("B300").Select
ActiveWindow.LargeScroll Down:=-1
Range("B275").Select
ActiveWindow.LargeScroll Down:=-1
Range("B250").Select
ActiveWindow.LargeScroll Down:=-1
Range("B225").Select
ActiveWindow.LargeScroll Down:=-1
Range("B200").Select
ActiveWindow.LargeScroll Down:=-1
Range("B175").Select
ActiveWindow.LargeScroll Down:=-1
Range("B150").Select
ActiveWindow.LargeScroll Down:=-1
Range("B125").Select
ActiveWindow.LargeScroll Down:=-1
Range("B100").Select
ActiveWindow.LargeScroll Down:=-1
Range("B75").Select
ActiveWindow.LargeScroll Down:=-1
Range("B50").Select
ActiveWindow.LargeScroll Down:=-1
Range("B25").Select
ActiveWindow.LargeScroll Down:=-1
Range("B25").Select
ActiveWindow.SmallScroll Down:=6
Range("A1:B26").Select
Range("B26").Activate
Selection.Delete Shift:=xlUp
ActiveWindow.SmallScroll Down:=-30
Range("D17").Select
End Sub






here is the macro with all the combined macos:
Public Sub Compile()
Application.Run "'BKW Proposal2.xls'!clear_errorsMid"
Application.Run "'BKW Proposal2.xls'!clear_rows"
Application.Run "'BKW Proposal2.xls'!Sort"
Application.Run "'BKW Proposal2.xls'!copyy"
Application.Run "'BKW Proposal2.xls'!sortforvlookup"
ActiveWindow.SmallScroll Down:=15
Range("D21").Select
End Sub





like i said, when i run 'sortforvlookup' by itself it works, but when i try
to run it through the macro 'Compile,' i get the following error:


Run-Time error '1004':
This operation requires the merged cells to be identitcally sized.

when i go to debug, the following of 'sortforvlookup' is highlighted:

Range("A1:B500").Select
Range("B500").Activate
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal


with the arrow being on "DataOption1:=xlSortNormal"


This is weird because none of the cells are merged. any ideas what this is
about? thanks.

 
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
How can I sort an Excel Doc containing merged & non-merged cells? KellyH Excel Discussion (Misc queries) 11 June 10th 08 04:12 AM
hiding rows with merged cells using macros [email protected] Excel Programming 1 January 21st 08 05:33 PM
Autofit Merged cell Code is changing the format of my merged cells JB Excel Discussion (Misc queries) 0 August 20th 07 02:12 PM
how do i link merged cells to a merged cell in another worksheet. ibbm Excel Worksheet Functions 3 April 27th 06 11:40 PM
Sorting merged cellsHow do I sort merged cells not identically siz Laval Excel Worksheet Functions 1 November 3rd 04 09:40 PM


All times are GMT +1. The time now is 02:02 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"