View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
zhj23 zhj23 is offline
external usenet poster
 
Posts: 60
Default convert percentage to text

Hello! JE

Following your advice, I did the following (extracted codes)
---------------------------------
Dim bPercentFormat as Boolean

For each cell in selection
bPercentFormat = CBool(InStr(ActiveCell.NumberFormat, "%"))
MsgBox bPercentFormat
next cell
------------------------------------
It seems that the ActiveCell does not move with the FOR loop. What is the
remedy to this? Thanks.

zhj23


"JE McGimpsey" wrote:

One (simplistic) way:

Dim bPercentFormat As Boolean
bPercentFormat = CBool(InStr(Range("A1").NumberFormat, "%"))
MsgBox bPercentFormat


In article ,
zhj23 wrote:

Question: how can I evaluate in VBA whether a cell is in simple numeric or
percentage numeric form?