Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Desiree
 
Posts: n/a
Default Adding zero's to a group of cells

Hello, I need to figure out a way to convert a group of cells from three
digits to six. Essentially I want to take the numbers in the cells and
multiply them by 1000. I do not however want to go into each cell and add
the formula. I am creating a macro and this is the last piece of this.
Essentially I am looking for an easy out.
  #2   Report Post  
FSt1
 
Posts: n/a
Default

hi,
how is this group of cell layed out?
column? row? block?

FSt1

"Desiree" wrote:

Hello, I need to figure out a way to convert a group of cells from three
digits to six. Essentially I want to take the numbers in the cells and
multiply them by 1000. I do not however want to go into each cell and add
the formula. I am creating a macro and this is the last piece of this.
Essentially I am looking for an easy out.

  #3   Report Post  
Desiree
 
Posts: n/a
Default

It is in a block. For example block A1:E10

"FSt1" wrote:

hi,
how is this group of cell layed out?
column? row? block?

FSt1

"Desiree" wrote:

Hello, I need to figure out a way to convert a group of cells from three
digits to six. Essentially I want to take the numbers in the cells and
multiply them by 1000. I do not however want to go into each cell and add
the formula. I am creating a macro and this is the last piece of this.
Essentially I am looking for an easy out.

  #4   Report Post  
FSt1
 
Posts: n/a
Default

hi
try this....
Sub mactest()
Dim r As Range
Dim s As Range
Set r = Range("A1:E10")

For Each s In r
s.Value = s.Value * 1000
Next s
End Sub

worked in xl2k

regards
FSt1

"Desiree" wrote:

It is in a block. For example block A1:E10

"FSt1" wrote:

hi,
how is this group of cell layed out?
column? row? block?

FSt1

"Desiree" wrote:

Hello, I need to figure out a way to convert a group of cells from three
digits to six. Essentially I want to take the numbers in the cells and
multiply them by 1000. I do not however want to go into each cell and add
the formula. I am creating a macro and this is the last piece of this.
Essentially I am looking for an easy out.

  #5   Report Post  
Roger Govier
 
Posts: n/a
Default

One way
In a blank cell on your sheet enter 1000
Copy that cell
Mark the range of your data
Paste SpecialMultipy

--
Regards
Roger Govier
"Desiree" wrote in message
...
Hello, I need to figure out a way to convert a group of cells from three
digits to six. Essentially I want to take the numbers in the cells and
multiply them by 1000. I do not however want to go into each cell and add
the formula. I am creating a macro and this is the last piece of this.
Essentially I am looking for an easy out.





  #6   Report Post  
David McRitchie
 
Posts: n/a
Default

Hi Desiree,
Sorry had not read the question completely before starting an answer
to notice that you were writing a macro anyway/ The correct
group for macro questions is the programming group, but
mentioning the macro at least told us you know how to
install a macro.

you might compare this to the solution you were already provided, it
will reduce the cells processed to those in the selection range
that are numeric constants.

Sub macro11()
Dim cell As Range, rng As Range
Set rng = Intersect(Selection, _
Cells.SpecialCells(xlCellTypeConstants, xlNumbers))
If Not rng Is Nothing Then
For Each cell In rng
cell = cell * 1000
Next cell
End If
End Sub

The use of SpecialCells automatically limit the range to
the usedrange and the the operands are limiting it furtyer
to constants which are numeric. So you could apply it
to entire columns without trying to process each cell.

More on use of SpecialCell in
http://www.mvps.org/dmcritchie/excel/proper.htm with
additional portions in formula.htm


The rest was that I hadn't noticed you were looking for
a macro solution. Anything that shows a specific range
is kind of a warning that the solution is not a generic
one and that is why it first caught my attention.

For a non macro solution:
For multiplying cells a user specified range by 1000.

Anyway non macro solution.
Place 1000 into a cell, and copy it Ctrl+C
Then make a selection of the cells you want to change, then.
Edit menu, Paste Special, multiply
This solution will work on both constants and formula, may look
a little messy if you multiply formulas but you get what you ask for.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to group cells so that I can sort the upper most cell with. magnetoworld New Users to Excel 8 March 14th 05 07:17 PM
when adding cells resulting from tax calulations they do not equa. Marty Excel Discussion (Misc queries) 1 March 14th 05 02:38 PM
Adding colour to a range of cells based on one of the cells v... McKenna Excel Discussion (Misc queries) 4 March 11th 05 02:25 PM
Adding formatted cells to an outline ? Glenn Excel Discussion (Misc queries) 4 January 11th 05 04:10 PM
Adding cells with numbers and text EddieZ Excel Worksheet Functions 4 November 9th 04 12:43 PM


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