Here's the macro..... File attached too.

Sub FormatNumbersTo2Decimals()

    Dim wks As Worksheet
    Dim rng As Range

    For Each wks In ThisWorkbook.Worksheets
        For Each rng In wks.Cells.SpecialCells(2, 1)
            If IsNumeric(rng.Text) Then
                rng.NumberFormat = "0.00"
            End If
        Next
        For Each rng In wks.Cells.SpecialCells(-4123, 1)
            If IsNumeric(rng.Text) Then
                rng.NumberFormat = "0.00"
            End If
        Next
    Next

End Sub

Regards,
Sam Mathai Chacko
On Mon, Jan 23, 2012 at 6:31 PM, NOORAIN ANSARI
<noorain.ans...@gmail.com> wrote:
> Dear Zafar,
>
> First copy and value paste in New Sheet..
> Again copy and Select data of new sheet and Format paste .
>
> Hope it will help to you.
>
>
> --
> Thanks & regards,
> Noorain Ansari
> http://excelmacroworld.blogspot.com/
> http://noorain-ansari.blogspot.com/
>
> On Mon, Jan 23, 2012 at 2:28 PM, Zafar Iqbal <ziqba...@gmail.com> wrote:
>>
>> Dear Experts,
>>
>> Attached is an Sample file Excel-2003 with 03 Sheets linked with each
>> others. Sheet1 is linked with data from Sheet2 by Hlookup / index formulas
>> and it has Data Validation at Cell H1, too. Chart in this Sheet1 is also
>> linked with Data at Sheet2.
>>
>> Sheet3 will get data by Paste Special from MS Project file which results
>> in figures with more than 2 decimals. We need to e-mail only Sheet1 (with
>> Data + Chart) to Management without any formula. We make copy of Sheet1 and
>> save it in new file. Resultant file has chart and data with more than 2
>> decimals. Please provide us macro which will permanently round data to 2
>> decimals in Sheet + Chart and it will not disturb cells having text values
>> coming from Hlookup, Index, etc.
>>
>> Thanks for your guidance, in advance.
>>
>>
>>
>> Regards,
>> ZAFAR IQBAL
>>
>> --
>> FORUM RULES (986+ members already BANNED for violation)
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
>> not get quick attention or may not be answered.
>>
>> 2) Don't post a question in the thread of another member.
>>
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>>
>> 4) Acknowledge the responses you receive, good or bad.
>>
>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>> signatures are prohibited.
>>
>> NOTE : Don't ever post personal or confidential data in a workbook. Forum
>> owners and members are not responsible for any loss.
>>
>>
>> ------------------------------------------------------------------------------------------------------
>> To post to this group, send email to excel-macros@googlegroups.com
>
>
>
>
> --
> FORUM RULES (986+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
> not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to excel-macros@googlegroups.com



-- 
Sam Mathai Chacko

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Attachment: Paste Special with 2 decimals.xls
Description: MS-Excel spreadsheet

Reply via email to