ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Essbase: Text zeros to number zeros (https://www.excelbanter.com/excel-discussion-misc-queries/136091-essbase-text-zeros-number-zeros.html)

santhu

Essbase: Text zeros to number zeros
 
Hi All,

I have just written a macro for converting all text zeros to number
zeros in a given selection of range of cells. I thought I would share
this with the group from which I learnt so many new things.

Apologies if this topic is already dealt before (i searched but didnt
find any).

This macro puts "1" in IV65536 and multiplies the selection with this
before clearing the cell IV65536.

Here is the macro:
--------------------------------------------------------------------------------------------------------------------
Application.Goto Reference:="R1C1"
Dim MySelection As Range
Set MySelection = Application.InputBox(prompt:="Select a range of
cells", Type:=8)
Application.Goto Reference:="R65536C256"
ActiveCell.FormulaR1C1 = "1"
Selection.Copy
MySelection.Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Application.Goto Reference:="R65536C256"
Range("IV65536").Select
Selection.ClearContents
MySelection.Select

----------------------------------------------------------------------------------------------------------------------

Thanks,
Prasanth Dangeti


Dave F

Essbase: Text zeros to number zeros
 
Yes, the method of multiplying a selection of text-formatted numbers by 1 to
convert hem to number-formatted numbers is the standard solution to forcing
text-formatted numbers to become number-formatted.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"santhu" wrote:

Hi All,

I have just written a macro for converting all text zeros to number
zeros in a given selection of range of cells. I thought I would share
this with the group from which I learnt so many new things.

Apologies if this topic is already dealt before (i searched but didnt
find any).

This macro puts "1" in IV65536 and multiplies the selection with this
before clearing the cell IV65536.

Here is the macro:
--------------------------------------------------------------------------------------------------------------------
Application.Goto Reference:="R1C1"
Dim MySelection As Range
Set MySelection = Application.InputBox(prompt:="Select a range of
cells", Type:=8)
Application.Goto Reference:="R65536C256"
ActiveCell.FormulaR1C1 = "1"
Selection.Copy
MySelection.Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Application.Goto Reference:="R65536C256"
Range("IV65536").Select
Selection.ClearContents
MySelection.Select

----------------------------------------------------------------------------------------------------------------------

Thanks,
Prasanth Dangeti




All times are GMT +1. The time now is 06:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com