Solved

How to set number/text format in Excel or PPT datasheet cells?

Posted on 2006-06-22
2
813 Views
Last Modified: 2008-01-09
Hello all,

I have a chart in MS PowerPoint.  The chart is an actual chart with a datasheet, not just a pasted in image.  A VBA macro updates the datasheet with data for the chart.  But when it inputs a number range like "3 - 10" in the column header row of the datasheet - the row that holds the titles of the columns - PPT is then applying a data ormat to them and on my chart "3-10" becomes "10-March".

So I want to explicitly set the format of the datasheet cell to "text".  But I can't find the right code.  I assume t's the samew as for Excel, as I 've found that it usually is.

Anyone kow?

Thanks.
0
Comment
Question by:xfvgdrthbdtyvhgscv
2 Comments
 
LVL 17

Accepted Solution

by:
inthedark earned 500 total points
Comment Utility


Range("C5").Select ' the cell you want to change

Selection.NumberFormat = "@" ' format as text (do this first)

ActiveCell.FormulaR1C1 = "10-3" ' place in the data
0
 
LVL 1

Author Comment

by:xfvgdrthbdtyvhgscv
Comment Utility
Yes! We have a winner.  Worked perfectly.  Thanks a bunch.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now