LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Formatting a cell calculated by a VBA function

Yes, it is true that you can't change the formatting of a cell in
a function called from a worksheet cell.


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



wrote in message
oups.com...
Hi

Is it also true, that you cannot change the format of any Cell
within a
macro if the macro is run during the calculation of a cell?

In testing I have the following function

Function Format() As String
Range("A1").Font.Bold = True
Format = "Done"
End Function

Then i set Cell B1 to equal =Format() which runs the function,
I can
break execution in the function and execute the Bold = True
line, but
in the watch window the Property stays false.

However if i run the function from a button or by just running
the
macro, the line works and changes the cell text to bold.

Seems to me that the contents and formatting of the worksheet
is locked
and readonly while Excel is calculating a cell.
Is this true?

Thanks
Andy



 
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
Pivot table, IF function, calculated item versus calculated field NomadPurple Excel Discussion (Misc queries) 1 March 9th 10 03:17 PM
Copying formatting from a cell whose location I have calculated. sdm New Users to Excel 4 September 8th 08 08:40 PM
Formatting a calculated value in a cell Tim Excel Discussion (Misc queries) 5 November 28th 07 10:04 PM
How do I insert a calculated cell range into an excel function Gary Wallis Excel Worksheet Functions 2 April 26th 07 03:28 PM
Formatting numbers in each cell after I have calculated their valu Davidr004 Excel Worksheet Functions 1 April 10th 07 06:46 PM


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