Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel displays mess after input - OK after just a zoom????? | Excel Discussion (Misc queries) | |||
Quickbooks exports to Excel, cleaning up the mess afterwards | Excel Worksheet Functions | |||
Does 2 error handlers mess up excel? | Excel Programming | |||
Crl-Ed : another way to mess-up and fix | Excel Discussion (Misc queries) | |||
Fonts missing from latest Excel mess up my files. | Excel Programming |