View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Damien McBain[_4_] Damien McBain[_4_] is offline
external usenet poster
 
Posts: 16
Default "Object required" error - FOUND THE PROBLEM

Sorry - I answered my own question. I was using the wrong variable name
"c.column", should be "x.column"
doh

"Damien McBain" wrote in message
...
Hi,

Why does this produce an "Object Required" error and how can I fix it?
Column A contains worksheet names. Row 5 contains text representing a cell
reference like "G16".
==================
Sub FixFormulas1()
For Each x In Worksheets("Summary1").Range("B9:C30")
If Cells(x.Row, 1) < "" Then
x.Formula = "='" & Cells(x.Row, 1).Text & "'!" & Cells(5,
c.Column).Text
Else
End If
Next x
End Sub
==================
Thanks in advance,

Damien