Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Prevent conversion to date format

Hi,

In VBA, how can I set a cell to '1-0' without it being converted to
date format such as Jan-00? I don't want a macro either. I'm
actually generating Excel spreadsheets with Tcl and not VBA, but the
VBA answer should suffice.

Thanks,

Bob
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Prevent conversion to date format

Manually, you said you don't want a macro

Select cells and Numberformat (ctrl-1)
Apply the 'Text' item, or type a @ in Custom

or with code
rng.Numberformat = "@"

Regards,
Peter T

"Robert Lipman" wrote in message
...
Hi,

In VBA, how can I set a cell to '1-0' without it being converted to
date format such as Jan-00? I don't want a macro either. I'm
actually generating Excel spreadsheets with Tcl and not VBA, but the
VBA answer should suffice.

Thanks,

Bob



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Prevent conversion to date format

On Mar 27, 1:52 pm, "Peter T" <peter_t@discussions wrote:
Manually, you said you don't want a macro

Select cells and Numberformat (ctrl-1)
Apply the 'Text' item, or type a @ in Custom

or with code
rng.Numberformat = "@"

Regards,
Peter T

"Robert Lipman" wrote in message

...

Hi,


In VBA, how can I set a cell to '1-0' without it being converted to
date format such as Jan-00? I don't want a macro either. I'm
actually generating Excel spreadsheets with Tcl and not VBA, but the
VBA answer should suffice.



Thanks, but I need to do it in VBA, not manually either.

Bob
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,316
Default Prevent conversion to date format

Prefacing the entry with an apostrophe makes it a label and the following
snippet inserts the entry in the currently active cell:

Application.ActiveCell.Value = "'1-0"
--
Kevin Backmann


"Robert Lipman" wrote:

Hi,

In VBA, how can I set a cell to '1-0' without it being converted to
date format such as Jan-00? I don't want a macro either. I'm
actually generating Excel spreadsheets with Tcl and not VBA, but the
VBA answer should suffice.

Thanks,

Bob

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Prevent conversion to date format

"Robert Lipman" wrote in message
...
On Mar 27, 1:52 pm, "Peter T" <peter_t@discussions wrote:
Manually, you said you don't want a macro

Select cells and Numberformat (ctrl-1)
Apply the 'Text' item, or type a @ in Custom

or with code
rng.Numberformat = "@"

Regards,
Peter T

"Robert Lipman" wrote in message


...

Hi,


In VBA, how can I set a cell to '1-0' without it being converted to
date format such as Jan-00? I don't want a macro either. I'm
actually generating Excel spreadsheets with Tcl and not VBA, but the
VBA answer should suffice.



Thanks, but I need to do it in VBA, not manually either.

Bob


I'm confused, you said you don't want a macro so I showed how to do it
manually, but also I posted the equivalent VBA code.

Regards,
Peter T


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
permanent conversion of 1904 date format to 1900 date format Jos Excel Worksheet Functions 4 November 26th 15 02:48 PM
date format conversion ezil Excel Programming 2 December 26th 07 06:54 PM
Excel-How Do I prevent data conversion to date format MadHatter8_10 Excel Programming 3 September 30th 07 08:28 PM
Date format conversion Terry Pinnell Excel Discussion (Misc queries) 5 November 21st 05 07:53 PM
Date Format - Conversion tinkertoy Excel Discussion (Misc queries) 1 July 14th 05 06:24 PM


All times are GMT +1. The time now is 07:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"