Solved

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

Posted on 2006-06-22
2
819 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Suggested Courses
Course of the Month10 days, 17 hours left to enroll

628 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