Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default Help req in merging cells

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Help req in merging cells

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default Help req in merging cells

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
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
Merging cells Al_baker Excel Discussion (Misc queries) 5 December 6th 06 02:01 PM
merging 3 cells into 1 [email protected] Excel Discussion (Misc queries) 5 October 20th 06 08:43 PM
Merging Cells DC Excel Discussion (Misc queries) 4 February 21st 06 06:42 PM
Merging a ton of cells [email protected] Excel Worksheet Functions 1 February 13th 06 08:37 PM
Merging Cells BruceT Excel Worksheet Functions 1 December 2nd 04 06:38 AM


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