Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Blank rows appearing at top after sorting

I have an excel file with names in Column 'A' which starts with "MR " O
"MRS " as prefix. and I have the formula in B as follows.
IF(A1="","",IF(LEFT(A1,3)="MR ",MID(A1,4,LEN(A1)-3),IF(LEFT(A1,4)="MR
",MID(A1,5,LEN(A1)-4),A1)))

It works perfect
and I am running the following macro to sort column B alphabeticaly
but after sorting, the empty rows are apprearing at beginning. Ca
anyone help me???????
Sub Macro4()
Range("A1:B" & Range("B500").End(xlUp).Row).Select
Selection.Sort Key1:=Range("b1"), Order1:=xlAscending, Header:=xlNo
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

End Sub

Thanks in advance
G

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Blank rows appearing at top after sorting

I've given you a reply in your multi-post in .worksheet.functions

--
hth
Max
-----------------------------------------
Please reply in thread
Use xdemechanik <atyahoo<dotcom for email
--------------------------------------------------------


  #3   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Blank rows appearing at top after sorting

Oops, correction. Should be:

I've given you a reply in your multi-post in .misc


Rgds
Max
-----------------------------------------
Use xdemechanik <atyahoo<dotcom for email
--------------------------------------------------------


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
VALUE appearing (referencing blank cell) Mark D[_2_] Excel Worksheet Functions 3 March 29th 10 05:28 PM
Sorting to Include Blank Rows Robert M Excel Discussion (Misc queries) 2 July 14th 07 12:57 PM
#REF appearing when cells,rows,cols are all protected PJG Excel Discussion (Misc queries) 0 April 16th 07 03:43 PM
Excel adding blank rows when sorting [email protected] Excel Discussion (Misc queries) 2 September 23rd 06 05:30 PM
blank rows and sorting problem..plz help me... naughtyboy Excel Discussion (Misc queries) 2 August 8th 06 08:03 PM


All times are GMT +1. The time now is 06:38 PM.

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

About Us

"It's about Microsoft Excel"