Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is Excel is now going out of it's way to mess me around?


HOW COME THIS WORKS
if I place this formula in a cel

=IF(A1 < "",ResetFont()

And in Module1 the Subroutine i

Sub ResetFont(
msgBox(ActiveCell.Value
End su

BUT THIS DOESNT
Sub ResetFont(
ActiveCell.Font.Size = 1
End su

ALSO IF I TRY
Sub ResetFont(
ActiveCell.Value = "1
End su

*It throws an error in the cell with the =IF(...?

--
Willo
-----------------------------------------------------------------------
Willot's Profile: http://www.excelforum.com/member.php...fo&userid=3516
View this thread: http://www.excelforum.com/showthread.php?threadid=54974

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Is Excel is now going out of it's way to mess me around?

The first one works because the Sub doesn't attempt to change any
property of Excel.


"Willot"
wrote in message
...

HOW COME THIS WORKS?
if I place this formula in a cell

=IF(A1 < "",ResetFont())


And in Module1 the Subroutine is

Sub ResetFont()
msgBox(ActiveCell.Value)
End sub


BUT THIS DOESNT?
Sub ResetFont()
ActiveCell.Font.Size = 10
End sub


ALSO IF I TRY
Sub ResetFont()
ActiveCell.Value = "1"
End sub

*It throws an error in the cell with the =IF(...?*


--
Willot
------------------------------------------------------------------------
Willot's Profile:
http://www.excelforum.com/member.php...o&userid=35166
View this thread:
http://www.excelforum.com/showthread...hreadid=549742



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is Excel is now going out of it's way to mess me around?


Yep. I see that. I just dont understand why it has a problem with th
fact I want to change a properity of the cell.
Is Excel just having one of it's turns

--
Willo
-----------------------------------------------------------------------
Willot's Profile: http://www.excelforum.com/member.php...fo&userid=3516
View this thread: http://www.excelforum.com/showthread.php?threadid=54974

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Is Excel is now going out of it's way to mess me around?

Functions called from a worksheet cell cannot change any other
cell. This restriction is so that Excel can maintain its table of
precedent and dependent cells. If VBA functions called from a
worksheet cell were allowed to change cell values, Excel would
have no idea how to calculate the sheet while preserving a valid
table of precedents and dependents. It wouldn't have any idea
what cells the VBA code might change.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Willot"
wrote in message
...

Yep. I see that. I just dont understand why it has a problem
with the
fact I want to change a properity of the cell.
Is Excel just having one of it's turns?


--
Willot
------------------------------------------------------------------------
Willot's Profile:
http://www.excelforum.com/member.php...o&userid=35166
View this thread:
http://www.excelforum.com/showthread...hreadid=549742



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
Excel displays mess after input - OK after just a zoom????? Leon[_2_] Excel Discussion (Misc queries) 0 October 30th 09 02:37 PM
Quickbooks exports to Excel, cleaning up the mess afterwards Mick Warren, TechniCater Excel Worksheet Functions 1 April 25th 06 07:15 PM
Does 2 error handlers mess up excel? Nicole Seibert Excel Programming 4 April 5th 06 11:13 PM
Crl-Ed : another way to mess-up and fix Patricia Shannon Excel Discussion (Misc queries) 0 March 23rd 06 06:39 PM
Fonts missing from latest Excel mess up my files. Paul Brown Excel Programming 3 January 20th 05 06:24 PM


All times are GMT +1. The time now is 08:11 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"