View Single Post
  #3   Report Post  
rgarber50
 
Posts: n/a
Default


When I try:
Productivity = Format(Range("A1").Value, "#.0 %")

I get 070.0%. Now I am using a Macintosh - wonder if that is effecting
the formatting?

Here is a test macro I tried - it also errors out at the do while loop.

[A1 is a % formatted formula =B3; B3 is a formula B5/B4; B4 =40 and B5
= 20). The idea here is how much does B5 (key) have to be for
productivity(A1) to equal 70%. Of course the answer in the test is 28
(70% productivity in a 40/hr week = 28hrs)

Public Sub Testvalues()

Dim Productivity, Key
Productivity = Format(Range("A1").Value, "#.0 %")
MsgBox Productivity '
returns 070.0%

Key = Range("A5").Value

Do While Productivity < 0.7 '- runtime error 13; type
mismatch
Key.Value = Key + 0.25
Loop


End Sub

Any ideas would be appreciated.
Thanks
Richard


--
rgarber50
------------------------------------------------------------------------
rgarber50's Profile: http://www.excelforum.com/member.php...o&userid=11350
View this thread: http://www.excelforum.com/showthread...hreadid=385873