-
Import data from excel to powerpoint(% not showing)
Sir,
I need some help.
I want to import data from excel sheet which contains % ie 2%, 4%, .....( in column B)
but when import to powerpoint through vba it display as 0.02, 0.04 (not in 2% or 4%).
How it should display as 2% or 4%?
tbhm = GetObject(filepath).sheets(1).Range("B2:B6")
Application.Presentations(1).Slides(1).Shapes("Population").TextFrame.TextR ange.Text = tbhm(6, 1)
-
tbhm = GetObject(filepath).sheets(1).Range("B2:B6")
Application.Presentations(1).Slides(1).Shapes("Population").TextFrame.TextR ange.Text = FormatPercent(tbhm(6, 1))
-
sir,
After using
Application.Presentations(1).Slides(1).Shapes("Population").TextFrame.TextR ange.Text = FormatPercent(tbhm(6, 1))
it display 2% as 2.00% (not as 2% which I want)
Is there any solution without changing below line but any changes in excel sheet may give the result I wanted ?
tbhm = GetObject(filepath).sheets(1).Range("B2:B6")
Application.Presentations(1).Slides(1).Shapes("Population").TextFrame.TextR ange.Text = tbhm(6, 1)
-
you supply a 2nd parameter to the function. pass 0:
Application.Presentations(1).Slides(1).Shapes("Population").TextFrame.TextR ange.Text = FormatPercent(tbhm(6, 1), 0)
-
Thanks its working now.
But is there any solution to change only in excel sheet ie in column/cell because in many case I import text/string so don't want edit in "tbhm(6, 1)".
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules