#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Need help

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default Need help

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

"Geir" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Need help

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]
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Need help

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



Geir wrote:
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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Need help

Does this give you a hint.

for each cell S

But Thomas gave you a good answer.
--
Don Guillett
SalesAid Software

"Geir" wrote in message
...
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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Need help

Thanks Thomas it works fine.

Geir

"Thomas Ramel" wrote:

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]

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"