Formula refuses to Calculate

5L2F

New Member
Joined
Oct 15, 2005
Messages
11
I have 2 adjacent cells. One is for entering a number. The adjacent cell prints XXX if the adjacent number is less than 10 and YYY if the number is more than 10. Here is the code:

Code:
=IF(M18>9,"XXX","YYY")

If I enter a number manually it works fine. (y) But I don't want to enter it manually. I have created a macro that pops up a dialog box and I enter the number into the box. It then pastes the information on to the worksheet at M18.

My problem is that when it pastes from the dialog box, the adjacent cell does not recognise it. It does not do 'its thing.' The formula refuses to calculate. Can someone tell me what to do please?

Chris
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

NathanPage

New Member
Joined
Dec 8, 2005
Messages
9
You could try adding adding

Calculate

as the last line of your macro code?



Also, is your spreadsheet set to automatic calculation? (Tools->Options->Calculation->Automatic)
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Inputbox returns a string variable (and so do TextBoxes), so it may also be worthwhile casting the return as a value using the Val function (and have automatic calculation selected for the sheet). You don't post your code, so this is a guess, but it will look something like this:

Code:
Range("M18").Value = Val(Inputbox("Enter your number"))

Regards

Richard
 

Watch MrExcel Video

Forum statistics

Threads
1,119,144
Messages
5,576,322
Members
412,716
Latest member
thviid
Top