LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 2002 - Multiplication

Doug,

Thank you for explaining that to me. And, thank you again
for the help.

Sherri
-----Original Message-----
Sherri,

Range("A65536").End(xlUp) means the last non-empty cell

in the column. It's
saying start at the last row (65536) and go up to the

first cell with
contents (the "end"). This just the second part of the

larger range
statement Range("A1", Range("A65536").End(xlUp)), which

translates to "A1
through the last non-empty cell." If the range you're

looking at will
always be the same, you could use something like Range

("A1:A20"):

Sub test()

Dim r As Range

For Each r In Range("A1:A20")
r.Value = r.Value * 2
Next r

The first way is more flexible, because it will do all

the non-empty cells
in the column, assuming that's what you want.

hth,

Doug

End Sub
"Sherri" wrote in message
...
Doug,

Thank you very much.

Does the statement Range("A65536") mean the last row in
the worksheet? Can I customize that to the ending row I
want it to be?

And, the .End(x1up) statement is confusing to me.
Could you explain why that is needed, please?

Again, thank you.

Sherri

-----Original Message-----
Assuming your data begins in A1 and the constant is 2

this would do what you
want:

Sub test()

Dim r As Range

For Each r In Range("A1", Range("A65536").End(xlUp))
r.Value = r.Value * 2
Next r

End Sub

"Sherri Baker" wrote in

message
...
I would like to take a column of cells, traverse

through
them, multiply the number in each cell by a constant
value, and return the result into the same cell.

Any help will be greatly appreciated.


.



.



 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 Multiplication Question Stumped In Indy Excel Discussion (Misc queries) 7 November 3rd 08 01:54 AM
Excel 2007 multiplication bug - and more... JL Excel Discussion (Misc queries) 17 October 22nd 07 08:53 AM
Outlook 2002 calendar dates exported to Excel 2002 sort incorrectl scampbell Excel Worksheet Functions 0 February 22nd 06 06:31 PM
My question is about Excel how to create tables by multiplication BuckeyeBill Excel Discussion (Misc queries) 4 November 2nd 05 05:42 PM
Excel vs. calculator multiplication product discrepancy... Jray Excel Worksheet Functions 3 October 5th 05 10:40 PM


All times are GMT +1. The time now is 12:50 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"