Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default formula works when pasted, but not when typed

I have encountered a bizarre Excel 2003 bug that crops up from time to time.
Sometimes, a formula that is typed into a cell does absolutely nothing, i.e.,
Excel does not evaluate it. If I type the same formula into another cell and
then do a copy and paste, the formula works in the same location where it
previously failed to work. Here's the latest formula that I was using
where I encountered this problem.

=SUBTOTAL(103,$A$3:$A$64000)

I've verified that the cell format is "General" in both cases.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default formula works when pasted, but not when typed

Most likely, the original cell is formatted for Text, which means that
Excel won't convert what you type to a formula. When you copy/paste,
Excel recognizes it as a formula and changes the format upon the
paste.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Fri, 17 Oct 2008 14:00:01 -0700, Phillip M. Feldman
wrote:

I have encountered a bizarre Excel 2003 bug that crops up from time to time.
Sometimes, a formula that is typed into a cell does absolutely nothing, i.e.,
Excel does not evaluate it. If I type the same formula into another cell and
then do a copy and paste, the formula works in the same location where it
previously failed to work. Here's the latest formula that I was using
where I encountered this problem.

=SUBTOTAL(103,$A$3:$A$64000)

I've verified that the cell format is "General" in both cases.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default formula works when pasted, but not when typed

Your explanation is correct, but there's more to the story. Once one has
stored the formula in the cell, changing the format to numeric has no effect.
This is an Excel/VBA bug that I'd encountered years ago but forgotten about.
One must change the format to numeric _before_ writing the formula, as in the
following two statements:

ws.Cells(2, 1).NumberFormat = "0"
ws.Cells(2, 1).Formula = "=SUBTOTAL(103,$A$3:$A$64000)"

Thanks!
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
Need to use text typed in a cell C27 in formula Ex:Vlookup(C27.. excel help Excel Worksheet Functions 2 October 8th 09 06:11 PM
Typed or pasted text in a cell appears as #### susanhasquestion Excel Discussion (Misc queries) 6 September 19th 07 01:50 AM
formula typed contains an error associates Excel Worksheet Functions 1 June 11th 06 05:47 PM
carriage return that works when pasted into a text file (eg. Notep Chris Glen Excel Discussion (Misc queries) 3 February 14th 06 03:01 AM
How do I apply a formula to #s already typed in a series of cells redinBR Excel Worksheet Functions 1 May 18th 05 11:09 PM


All times are GMT +1. The time now is 03:40 AM.

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

About Us

"It's about Microsoft Excel"