Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default How can you determine if a cell is formatted as a percent?

Hello, I am using VBA in Excel XP with Win 2000

I need a VBA method to determine if a cell is formatted as a percentage

Could someone please post back example code to do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default How can you determine if a cell is formatted as a percent?

Hi Quartz,

I need a VBA method to determine if a cell is formatted as a percentage.


If InStr(ActiveCell.NumberFormat, "%") Then
MsgBox "Percentage"
Else
MsgBox "Other"
End If


Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How can you determine if a cell is formatted as a percent?

MsgBox ActiveCell.NumberFormat = "0.00%"

HTH
Regards
Pascal

"quartz" a écrit dans le message de
news: ...
Hello, I am using VBA in Excel XP with Win 2000.

I need a VBA method to determine if a cell is formatted as a percentage.

Could someone please post back example code to do this?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default How can you determine if a cell is formatted as a percent?

Thanks Jan! I never thought of using "InStr" like that :-

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
Using date format in the cells how determine percent complete boiseman62 Excel Worksheet Functions 2 January 27th 08 12:19 AM
Calculating percent off a single cell Dimwit Excel Discussion (Misc queries) 1 October 10th 06 03:14 PM
remove percent symbol on percentage formatted cells in excel IncognitoPC Excel Discussion (Misc queries) 1 April 18th 06 06:32 PM
Formatting a number to look like a Percent without a percent sign David Iacoponi Excel Discussion (Misc queries) 2 September 15th 05 06:35 PM
Converting 'General' formatted cells to Text formatted cell using. Zahid Khan Excel Worksheet Functions 1 March 12th 05 07:13 PM


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