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

Perfect!! Many Thanks.

zhj23

"JE McGimpsey" wrote:

You're right, ActiveCell doesn't change unless you Activate or Select a
range. Use your range object variable instead:

Dim rCell As Range
Dim bPercentFormat as Boolean

For each rCell In Selection
bPercentFormat = CBool(InStr(rCell.NumberFormat, "%"))
MsgBox bPercentFormat
Next rCell

In article ,
zhj23 wrote:

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.