View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Merge Cells run-time error '1004'

Sub abc()
CommonRowInd = 1
CommonColInd = 25
With Worksheets("DIFF")
.Range(.Cells(CommonRowInd, CommonColInd), _
.Cells(CommonRowInd + 1, CommonColInd)).Merge
End With
End Sub

worked fine for me on a new sheet. It didn't require the the sheet DIFF be
active.

--
Regards,
Tom Ogilvy



"darxoul" wrote:

Could anyone help me about the problem with this line of Macro?

Worksheets("DIFF").Range(Cells(CommonRowInd, CommonColInd),
Cells(CommonRowInd + 1, CommonColInd)).Select
Selection.Merge

When I debug, CommonRowInd is 1 and CommonColInd is 25 (as expected). I try
to merge two cells, but I have this problem.

Any suggestions?