Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-06-22
2
Medium Priority
?
820 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

722 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