Solved

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

Posted on 2006-06-22
2
815 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
ID: 16959414


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
ID: 16964968
Yes! We have a winner.  Worked perfectly.  Thanks a bunch.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

777 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