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

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 01:46 PM.

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"