ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting Cell Type From Word Macro (https://www.excelbanter.com/excel-programming/349468-setting-cell-type-word-macro.html)

IWT

Setting Cell Type From Word Macro
 
Hi,

I'm writing a macro in Word that copies some data over from Word and
puts it into an Excel spreadsheet.

My question is, how do you define the type (e.g. text/number/date etc)
of a cell in Excel. I have some values with an undefined number of
leading zeros so would like to define them as text instead.

Many thanks,

Tom


Kevin B[_5_]

Setting Cell Type From Word Macro
 
You could concatenate an apostrophe as a prefix character to the values with
leading zeroes to convert them to text.

--
Kevin Backmann


"IWT" wrote:

Hi,

I'm writing a macro in Word that copies some data over from Word and
puts it into an Excel spreadsheet.

My question is, how do you define the type (e.g. text/number/date etc)
of a cell in Excel. I have some values with an undefined number of
leading zeros so would like to define them as text instead.

Many thanks,

Tom




All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com