View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
evgny[_2_] evgny[_2_] is offline
external usenet poster
 
Posts: 28
Default Concatenate Non Blank Cells


Soniya wrote:
Range("C1").FormulaR1C1 = _
"=IF(RC1="""","""",CONCATENATE(RC1,""}"",RC2)) "



hi ssjody

try this

Sub a()
Worksheets("Ark1").Activate
Dim colA As Double ' CHECK HOW MANNY ROWS IN COLUMNS A
Dim colB As Double ' CHECK HOW MANNY ROWS IN COLUMNS B
Dim Big As Double
Dim i As Double
colA = Cells(Rows.Count, "B").End(xlUp).Row
colB = Cells(Rows.Count, "B").End(xlUp).Row
If colA colB Then
Big = colA
Else
Big = colB
End If
For i = 1 To Big
If Range("A" & i) 0 Then

Range("C" & i) = Range("A" & i) & Range("B" & i)
End If
Next i
End Sub

Regards yngve