0

My scenario is , I have one Excel sheet. On the same sheet in cell A2 I am inserting the data through code and cell B2 I already put the data manually before inserting the data in cell A2, in cell C2 I written the formula =EXACT(A2,B2).

Now when I run the code, the code put the value in cell A2,and the Status should be change according to the condition given and the data on both cells. But it doesn't change the status according to the formula in cell C2 and the status gets changed when I double click on that particular cell and enter then the condition work. Please tell me how it will be possible without double click on the particular cell?

Bart
  • 19,692
  • 7
  • 68
  • 77
  • possible duplicate of [How do you get Excel to refresh data on sheet from within VBA?](http://stackoverflow.com/questions/154434/how-do-you-get-excel-to-refresh-data-on-sheet-from-within-vba) – Andrew Leach Jun 08 '12 at 07:18
  • Your comment indicates you're using Java not VBA (I'd assumed VBA and it appears at least one other person has, too). Can you add a tag for the coding language you are using, please? – Andrew Leach Jun 08 '12 at 20:32

1 Answers1

-1

This works (I've tested it) if automatic calculation is switched on (Excel Options->Formulas->Calculation Options).

Here's the code (I'm using A1, B1, C1):

Private Sub CommandButton1_Click()
  Cells(1, 1).Value = 2
End Sub
smirkingman
  • 6,167
  • 4
  • 34
  • 47
  • Thanks for your reply but i am not getting your point, how and where i have to write this code. I am using java to write the code to fill the value in cell A. Can you explain me little bit it will be really appreciable. – user138201 Jun 08 '12 at 17:26