LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Error when entering a formula

Sorry Ken, I gave it a little too cursory a read. You WERE using the VBA
Replace function and I somehow got the worksheet function version in my head.
As I said, it's late for me. Sorry I couldn't have had more to offer.

Greg

"Greg Wilson" wrote:

I never use the Replace worksheet function nor deal with the international
list separator issue. I have on occasion used the VBA Replace function which
is significantly different. (You can achieve much the same as the VBA version
through EditReplace I believe). Also, a reminder that I'm no expert.

My version of the Excel's Replace worksheet function (xl2000 sp3) has 5
required arguments: old_text, start_num, num_chars and new_text. Your post
shows only 3. This seems appropriate only for the VBA Replace function and I
suggest this may be the source of the problem. I couldn't glean from your
posts if this interpretation is appropriate.

Unfortunately, the Replace worksheet function as I understand it doesn't
appear to support what you're trying to do. It apparently will only allow you
to replace a single block of text within the original text as opposed to
multiple and separate instances of text (in your case a single character)
within the original text. It's late and I'm off to bed so I can't give this
more than a cursory evaluation. I suggest you confirm/deny this and if
confirmed try another approach.

Sorry for the typo in my post. I'm sure you got the point anyway. Should
have been:

Cell A1 has the formual "=A1 + B1" in it. If you query the VALUE property of
the cell then it will return the result of the formula, i.e. 22 if A1 = 10
and B1 = 12. However, if you query the Formual property then it will return
"=A1 + B1".

Best regards,
Greg

"ken4capitola" wrote:

Thanks Greg,
Sorry for the mistyping of the equation. In this simplistic example, A
and B are names of cells containing values. My suggestion to the user
didn't correct the problem as I think your responses are indicating.

The actual code is shown below. The replace statement is to allow the
code to work on both sides of the Atlantic( "," vs ";" problem). The
statement does work with both listseparators as verified by others. As
above, the names you see are range names containing values that should
be ok.

Any idea how someone could have a Excel setting that would prevent the
assignment not to work.

Dim ListSep As String
Dim BackComma As String
BackComma = "\,"
ListSep = Application.International(xlListSeparator)
...
WKS.Range("AD17") = Replace("=IF(iVO2Min<wVO2MinLow \, wVO2MinLow \,
IF(iVO2Min<wVO2MinHigh \, wVO2MinHigh \, iVO2Min))", BackComma,
ListSep)

Next step is that I've ask to the Austria user to manually enter the
code into the spreadsheet when the VBA error breaks. He will enter
= IF(iVO2Min<wVO2MinLow ; wVO2MinLow ; IF(iVO2Min<wVO2MinHigh ;
wVO2MinHigh ; iVO2Min))

I'm hoping his manually entering will fail because of some Excel
setting. But this is getting out of my league.
Any other ideas?


 
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
Entering Formula - Cannot select cell as it is hidden by formula Jim Excel Worksheet Functions 0 March 25th 10 07:22 AM
Help - error entering data into cell NEHicks Excel Worksheet Functions 0 October 2nd 09 04:59 PM
Entering a Formula; Remains a Formula Instead of Calculating billbrandi Excel Discussion (Misc queries) 1 April 3rd 08 12:50 AM
Entering IF formula PamiS Excel Worksheet Functions 4 March 21st 07 01:36 PM
Error when entering and exiting excel Randy Excel Discussion (Misc queries) 1 January 11th 05 03:17 PM


All times are GMT +1. The time now is 05:11 AM.

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"