LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default Merging rows- urgent help req

How do i correctt he following code for merging rows of columns A1 which has
the same value.. foreg., teh column is sorted. Now if i have 3 names aclled
A, i should mak ethem as one A and when i reach teh next row with another
name B it shouls check till where teh name B is and should merge the entire B
into one B . Is it possible thru teh following code. i have given 2 codes ,
both don work Pls rectify.. Thank you for any help provided in advance.



Sub merge()
Dim i As Long, j As Long
Selection = RAnge ("A1:A1000")
For i = 3 To Selection.Areas.Count
For j = 3 To Selection.Areas(i).Rows.Count
Application.DisplayAlerts = False
Selection.Areas(i).Rows(j).MergeCells = True
Next
Next

End Sub



( or)


Name = "A"
st = i
en = i
for i = 3 to 1000
If (Name = Sheets("FTP").Cells(i, 1).Value) Then
Range("A" &st& ":Je" &en).Merge
name = Sheets("FTP").Cells(i+1, 2).Value

Else
st = i + 1
en = i
End If


 
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
Combining/Merging Rows Grace[_2_] Excel Discussion (Misc queries) 1 October 10th 07 01:03 AM
Merging Data in Different Rows crcurrie Excel Discussion (Misc queries) 8 May 5th 07 11:19 PM
Converting Rows into colums(Urgent) Saif1k Excel Worksheet Functions 7 January 14th 06 11:32 AM
Merging rows Peter Horrocks New Users to Excel 1 November 15th 05 12:01 PM
Merging Two Rows Into One Ourania Excel Worksheet Functions 1 March 18th 05 10:07 AM


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