View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Birley Dave Birley is offline
external usenet poster
 
Posts: 171
Default Macro fails in different WB

Here's a macro that works perfectly in one of my workbooks:

Sub UnsplitNames()
Dim myCell As Range
For Each myCell In Range("E6", Range("E65536").End(xlUp))
myCell(1, 13).FormulaR1C1 = "=RC[-14] & "", "" & RC[-13]"
Next myCell
End Sub

Here's the same macro slightly hacked as added to a different WB:

Sub UnsplitNames()
Dim myCell As Range
For Each myCell In Range("A2", Range("A65536").End(xlUp))
myCell(1, 27).FormulaR1C1 = "=RC[-26] & "", "" & RC[-25]"
Next myCell
End Sub

...and it returns "=RC[-26] & "", "" & RC[-25]" in pretty blue text in every
cell.

Where did I go wrong, Mother darling?
--
Dave
Temping with Staffmark
in Rock Hill, SC