+ Reply to Thread
Results 1 to 3 of 3

Change the Data Type

  1. #1
    Selv
    Guest

    Change the Data Type


    Currently, I am working on an application that opens an Excel spreadsheets
    and populates it with data. However, I have been unable to find any
    documentation on how to change the data type in a Cell or range. I would
    like to change a cell from "General" to "Percentage" data type format from
    within the VB application.

    An example of the other api funcation I am using which work correctly is:

    ExApp.Worksheets("Sheet1").Range("A1").Bold = True

    Unfortunately, I cannot find the property name for data type, which likely
    replaces "Bold".

    Any help would be appreciated.

    Thanks



  2. #2
    Andy Wiggins
    Guest

    Re: Change the Data Type

    Selection.NumberFormat = "0.00%"

    Hint: use the macro recorder.

    --
    Andy Wiggins FCCA
    www.BygSoftware.com
    Excel, Access and VBA Consultancy
    -

    "Selv" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Currently, I am working on an application that opens an Excel spreadsheets
    > and populates it with data. However, I have been unable to find any
    > documentation on how to change the data type in a Cell or range. I would
    > like to change a cell from "General" to "Percentage" data type format from
    > within the VB application.
    >
    > An example of the other api funcation I am using which work correctly is:
    >
    > ExApp.Worksheets("Sheet1").Range("A1").Bold = True
    >
    > Unfortunately, I cannot find the property name for data type, which likely
    > replaces "Bold".
    >
    > Any help would be appreciated.
    >
    > Thanks
    >
    >




  3. #3
    Rod Gill
    Guest

    Re: Change the Data Type

    It should be Font.Bold=True. You will also get more help in the Excel vba
    newsgroup: this one is dedicated to MS Project.

    --

    Rod Gill
    Project MVP
    Visit www.msproject-systems.com for Project Companion Tools and more


    "Andy Wiggins" <[email protected]> wrote in message
    news:[email protected]...
    > Selection.NumberFormat = "0.00%"
    >
    > Hint: use the macro recorder.
    >
    > --
    > Andy Wiggins FCCA
    > www.BygSoftware.com
    > Excel, Access and VBA Consultancy
    > -
    >
    > "Selv" <[email protected]> wrote in message
    > news:[email protected]...
    >>
    >> Currently, I am working on an application that opens an Excel
    >> spreadsheets
    >> and populates it with data. However, I have been unable to find any
    >> documentation on how to change the data type in a Cell or range. I would
    >> like to change a cell from "General" to "Percentage" data type format
    >> from
    >> within the VB application.
    >>
    >> An example of the other api funcation I am using which work correctly is:
    >>
    >> ExApp.Worksheets("Sheet1").Range("A1").Bold = True
    >>
    >> Unfortunately, I cannot find the property name for data type, which
    >> likely
    >> replaces "Bold".
    >>
    >> Any help would be appreciated.
    >>
    >> Thanks
    >>
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1