Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Determinging the Format of a cell

Is there a way to determine whether a cell has been formatted as a PCT%?
Thanks in advance for your help with this.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 188
Default Determinging the Format of a cell

"Ric Payne" wrote in message
om...

Is there a way to determine whether a cell has been formatted as a
PCT%? Thanks in advance for your help with this.


Hi Ric,

Try the CELL function:

=IF(CELL("format",A1)="P0","Percent_0","Other")

HTH,

Alan.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Determinging the Format of a cell

Ric,

Alternatively, you can do it without needing to know all the names of the
formats that might be applied, which is probably more flexible. This picks
up any format ending iwth a percentage.

Function IsPercentFormat(rngCell as range) as boolean
Dim strFormat as String
'note no error traps for multiple cell range
strFormat= rngCell.NumberFormat
If (InStr(1, strFormat, "%", 1)) 1 Then IsPercentFormat=True
End Function

--
Robin Hammond
www.enhanceddatasystems.com
Check out our XspandXL add-in


"Ric Payne" wrote in message
om...
Is there a way to determine whether a cell has been formatted as a PCT%?
Thanks in advance for your help with this.



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
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Excel Worksheet Functions 2 May 9th 23 07:42 PM
cell format - remove cell format pattern without effecting colors Bas Excel Discussion (Misc queries) 1 March 23rd 09 02:54 PM
Can cell format come from and change with reference cell format jclouse Excel Discussion (Misc queries) 1 November 29th 06 03:20 AM
Custom Cell format to mimic time format [email protected] Excel Discussion (Misc queries) 6 November 7th 06 09:17 PM
How do I copy data in single cell format to a merged cell format Paul Excel Discussion (Misc queries) 1 June 27th 05 11:00 AM


All times are GMT +1. The time now is 09:55 AM.

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

About Us

"It's about Microsoft Excel"