how put numberformt inside shape when show numbers

abdo meghari

Well-known Member
Joined
Aug 3, 2021
Messages
639
Office Version
  1. 2019
Hi experts
I search for way to show numberformat inside specific shape like this #,##0.00
this is what I have
VBA Code:
Sheets("INV_PUR").Shapes("Rectangle 3003").TextFrame.Characters.Text = Format(Sheets("INV_PUR").Shapes("Rectangle 3003").TextFrame.Characters.Text, "#,##0.00")
but doesn't work at all ,
any other way to succeed it ,please?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Try

VBA Code:
     Dim objShape As Shape
   
    Set objShape = Worksheets("INV_PUR").Shapes("Rectangle 3003")
   
    With objShape.TextFrame.Characters
        .Text = Format(.Text, "#,##0.00")
    End With

Dave
 
Upvote 0
Solution
thanks Dave, unfortunately still show number without formatting like this 10000 or 700 .

curious, worked ok for me which is result I assume you want?

1661675452773.png
 
Upvote 0
I really sorry Dave !!🙏

my bad I put the code in the beginning and surley I have another code , it seems to affected each other of them who the code should run firstly .I put in the ending of procedure and works greatly .

many thanks for your help:)
 
Upvote 0
no worries glad resolved & appreciate feedback

Dave
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top