Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
excellent person
 
Posts: n/a
Default how do i square all items in a colums w/out doinf it one-by-one?

I used the random number generator to generate 1000 numbers. Now I want to
square all 1000 items but obviously I dont want to do it one-by-one. How can
I do this instantly?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default how do i square all items in a colums w/out doinf it one-by-one?

Hi Excellent Person.

Try:

'============
Sub SquareEm()
Dim Rng As Range
Dim rCell As Range

Set Rng = Selection
For Each rCell In Rng.Cells
rCell.Value = rCell.Value ^ 2
Next rCell

End Sub
'<<============

If you are not familiar with macros, you may wish to visit David McRitchie's
'Getting Started With Macros And User Defined Functions' at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

---
Regards,
Norman


"excellent person" <excellent wrote in
message ...
I used the random number generator to generate 1000 numbers. Now I want to
square all 1000 items but obviously I dont want to do it one-by-one. How
can
I do this instantly?



  #3   Report Post  
Posted to microsoft.public.excel.misc
Biff
 
Posts: n/a
Default how do i square all items in a colums w/out doinf it one-by-one?

Hi!

Select the range of numbers.

Goto EditCopy

EditPaste SpecialMultiplyOK

Biff

"excellent person" <excellent wrote in
message ...
I used the random number generator to generate 1000 numbers. Now I want to
square all 1000 items but obviously I dont want to do it one-by-one. How
can
I do this instantly?



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 02:39 AM.

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

About Us

"It's about Microsoft Excel"