Need help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI
I have a problem. This Sub dont work. What can be wrong?


Sub cell()
For Each Cells In Range("A1:K120")
cell.Value = cell.Value
Next
End Sub
 
How do you know it "dont work"
All it does is replace each cell's value by what is already there. That is
to say, it does nothing.
Bernard
 
Grüezi Geir

Geir schrieb am 28.12.2004
I have a problem. This Sub dont work. What can be wrong?

Sub cell()
For Each Cells In Range("A1:K120")
cell.Value = cell.Value
Next
End Sub

Try the followiong instead:

Range("A1:K120").Value = Range("A1:K120").Value

--
Regards

Thomas Ramel
- MVP for Microsoft-Excel -

[Win XP Pro SP-1 / xl2000 SP-3]
 
Two things:

1) Change the name of your subroutine. You're using a reserved name
("cell").
2) Change "For Each Cells..." to "For Each Cell..."


-Glenn Ray
 
Does this give you a hint.

for each cell S

But Thomas gave you a good answer.
 
Thanks Thomas it works fine.

Geir

Thomas Ramel said:
Grüezi Geir

Geir schrieb am 28.12.2004
I have a problem. This Sub dont work. What can be wrong?

Sub cell()
For Each Cells In Range("A1:K120")
cell.Value = cell.Value
Next
End Sub

Try the followiong instead:

Range("A1:K120").Value = Range("A1:K120").Value

--
Regards

Thomas Ramel
- MVP for Microsoft-Excel -

[Win XP Pro SP-1 / xl2000 SP-3]
 

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