"Object required" error

  • Thread starter Thread starter Damien McBain
  • Start date Start date
D

Damien McBain

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
 
Sorry - I answered my own question. I was using the wrong variable name
"c.column", should be "x.column"
doh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top