Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trying to group cells so that I can sort the upper most cell with. | New Users to Excel | |||
when adding cells resulting from tax calulations they do not equa. | Excel Discussion (Misc queries) | |||
Adding colour to a range of cells based on one of the cells v... | Excel Discussion (Misc queries) | |||
Adding formatted cells to an outline ? | Excel Discussion (Misc queries) | |||
Adding cells with numbers and text | Excel Worksheet Functions |