Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
i have written the following code to merge cells inside a macro.
Name = "Prathap" S = 1 e = 1 For i = S To e If (Name < Sheets("FTP").Cells(i, 2).Value) Then Range(B,start:B,end) Name = Sheets("FTP").Cells(i, 2).Merge S = i + 1 e = i Here what i wanted to convey is taht i want to merge all the cells of columns A ,B and C for a particular name i col B. teh rest of teh columns need not be merged . and then the following name is also to bemerged the same way. The entries are dynamic . Im not able to proceed beyond this as im new to coding |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Perhaps this code can help you:
Sub mergge() For I = 1 To 10 If Cells(I, 2).Value = "Prathap" Then Range("A" & I & ":C" & I).merge End If Next End Sub -- Gary''s Student - gsnu200769 "deepika :excel help" wrote: i have written the following code to merge cells inside a macro. Name = "Prathap" S = 1 e = 1 For i = S To e If (Name < Sheets("FTP").Cells(i, 2).Value) Then Range(B,start:B,end) Name = Sheets("FTP").Cells(i, 2).Merge S = i + 1 e = i Here what i wanted to convey is taht i want to merge all the cells of columns A ,B and C for a particular name i col B. teh rest of teh columns need not be merged . and then the following name is also to bemerged the same way. The entries are dynamic . Im not able to proceed beyond this as im new to coding |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
this code is actually deleing all teh entries below that row... Actually i
want to only merge one column .. the other columns should not be merged.. I have written the following code which doent work i=3 Name = "Prathap" st = i en = i If (Name < Sheets("FTP").Cells(i, 2).Value) Then st = i + 1 en = i Else Sheets("FTP").Cells(i, 2).merge name = Sheets("FTP").Cells(i+1, 2).Value End If also teh structure has to be like : colA col B Col C Row1 1 Prathap paint row2 draw row3 2 Rohan test before the above , the structure is now like colA col B Col C Row1 1 Prathap paint row2 1 Prathap draw row3 2 Rohan test So howmany ever Prathap i see i should merge it to a single cell leaving col C unmerged and for teh rest of the rows... also this shud be teh case.. Can u help pls "Gary''s Student" wrote: Perhaps this code can help you: Sub mergge() For I = 1 To 10 If Cells(I, 2).Value = "Prathap" Then Range("A" & I & ":C" & I).merge End If Next End Sub -- Gary''s Student - gsnu200769 "deepika :excel help" wrote: i have written the following code to merge cells inside a macro. Name = "Prathap" S = 1 e = 1 For i = S To e If (Name < Sheets("FTP").Cells(i, 2).Value) Then Range(B,start:B,end) Name = Sheets("FTP").Cells(i, 2).Merge S = i + 1 e = i Here what i wanted to convey is taht i want to merge all the cells of columns A ,B and C for a particular name i col B. teh rest of teh columns need not be merged . and then the following name is also to bemerged the same way. The entries are dynamic . Im not able to proceed beyond this as im new to coding |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Merging cells | Excel Discussion (Misc queries) | |||
merging 3 cells into 1 | Excel Discussion (Misc queries) | |||
Merging Cells | Excel Discussion (Misc queries) | |||
Merging a ton of cells | Excel Worksheet Functions | |||
Merging Cells | Excel Worksheet Functions |