![]() There is no need foir the formatting at all.FormulaLocal and use your local language, of rewrite in US_EN Formula property expects US_EN format formula. If some of you code might error, you can use OERN tightly bound around that code, closely followed On Error GoTo ? and handle the specific error case Don't use a general On Error Resume Next - it just hides errors.' Target.Offset(rowoffset:=0, columnoffset:=2).Formula = Chr(61) & Value ' Value = "ALS(OF(ISGETAL(VIND.SPEC(""="" FORMULETEKST(" & Target.Address & ") 1))) FORMULETEKST(" & Target.Address & ") """")" ' Try to fill the cell in the B-column, who is preassigned now in the document Target.Formula = Chr(61) & Target.Formula Target.Formula = Replace(Target.Formula, "$", "")ĮlseIf Left(Target.Value, 4) = "=SOM" ThenĮlseIf Left(Target.Value, 1) = Chr(61) ThenĮlseIf Left(Target.Value, 1) Chr(61) Then ' Remove $ sign to make the formula non relative Target.Formula = Chr(61) & Target.Offset(rowoffset:=-1, columnoffset:=0).Address & Target.Formula Target.Formula = Replace(Target.Formula, "-", "-") Left(Target.Value, 2) = "-" Then ' Typ '-' to have a negative value ' Turn off events so a change doesn’t start an endless loop ' Do nothing if more than one cell is changed or content deleted Private Sub Worksheet_change(ByVal Target As Range) If ActiveCell.Column = 2 And ActiveCell.Row > 1 Then ActiveCell.Offset(columnoffset:=1).Select If Not Intersect(Target, Range("C1:C1000")) Is Nothing Then ' Force the input column cells to text to ensure the text value is there Private Sub Worksheet_SelectionChange(ByVal Target As Range) Note that the input cells in the C column are forced to text by NumberFormat = I could not find another solution to capture the input from the cells as 'normal' characters and avoid getting datums when using the '/' sign or not recognizing the '+' sign. The B column is preassigned now in the document, I've tried to add it by code but the cell stays empty, see the code, I've commented the tryout.When use =SIN(RADIANS(45)) I've had the same error while =SIN(45*PI()/180) is working normally.When I use an AutoSum in the B column like =SUM(C10:C11) the result will show an error like '#NAME?'.The B column is based on the 'FORMULATEXT' function looking at the C column, if the C column starts with '=' show the content, else stay empty. You can build on the cell above's result by, for example, simply only typing +10,*10,^2 and so on. ![]() In the C column you can enter numbers or calculations, the B column is showing the formula behind the result. It's just simple code and got the most things working. See also Excel equal sign as first character in cell ![]() I'm trying to create a simple 'daily calculator' in Excel in the style of programs like Speedcrunch and Speq.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |