i'm trying to make use of the pastespecial operation in excel to copy the contents of a couple of cells, merge the cells and then paste the combined contents into the merged single cell. however each time the program gets to the point of pasting, it comes up with a "pastespecial method of range class failed" error message. what am i doing wrong here?
Sub mergeCells()
'
' mergeCells Macro
' Macro recorded 31-01-2002 by Tunde Olugbesan
'
Dim str1 As String
str1 = ActiveCell.Value & "" & ActiveCell.Offset(0, 1).Value
ActiveCell.Range("A1:B1"
.Select
ActiveCell.Range("A1:B1"
.Copy
Selection.Merge
ActiveCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlPasteSpecialOperationAdd, SkipBlanks:=False, Transpose:=False
End Sub
Sub mergeCells()
'
' mergeCells Macro
' Macro recorded 31-01-2002 by Tunde Olugbesan
'
Dim str1 As String
str1 = ActiveCell.Value & "" & ActiveCell.Offset(0, 1).Value
ActiveCell.Range("A1:B1"
ActiveCell.Range("A1:B1"
Selection.Merge
ActiveCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlPasteSpecialOperationAdd, SkipBlanks:=False, Transpose:=False
End Sub