View Single Post
  #6   Report Post  
sumesh56 sumesh56 is offline
Senior Member
 
Posts: 118
Default

Quote:
Originally Posted by Claus Busch View Post
Hi,

Am Wed, 2 Apr 2014 17:27:14 +0100 schrieb sumesh56:

what you meant by Rows,count 3?


..Cells(rows.count,3).end(xlup).row
shows you the last row with values in column 3 (C)
For the range to look in you have to do no changes.
But you have to change E8 to G1.

I would like to see that after merging

the strings, i would delete Mystring and

the result should maintain.
have a nice day.


in G1 you have no trailing space behind your phrase. So you have to
insert the space with the code.
Try:

Sub Test()
Dim LRow As Long
Dim myStr As String
Dim rngC As Range

With ActiveSheet
LRow = .Cells(Rows.Count, 3).End(xlUp).Row
myStr = .Range("G1")
For Each rngC In .Range("C4:C" & LRow)
rngC = myStr & " " & rngC
Next
.Range("G1").ClearContents
End With
End Sub


Regards
Claus B.
--
Vista Ultimate SP2 / Windows7 SP1
Office 2007 Ultimate SP3 / 2010 Professional
Claus Busch,
thank you very much for the help. Your macro is perfect in all respect. have a nice day.