Thread: changing
View Single Post
 
Old 02-07-2012, 02:37 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi gsrikanth,

Try:
Code:
Sub CombineValues()
Dim i As Long
With ActiveSheet
  For i = 1 To .Cells.SpecialCells(xlCellTypeLastCell).Row
    If IsNumeric(Evaluate(.Range("A" & i).Value)) And IsNumeric(Evaluate(.Range("B" & i).Value)) Then
      .Range("B" & i).Value = Evaluate(.Range("A" & i).Value) + Evaluate(.Range("B" & i).Value)
    Else
      .Range("B" & i).Value = .Range("A" & i).Value & " " & .Range("B" & i).Value
    End If
      .Range("B" & i).NumberFormat = "General"
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote