Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm entering "=+1" into the input box (for example). This simply
returns the value 1 to the selected cell rather than apply +1 to the value already in the cell. Any ideas where i'm going wrong? --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I didn't notice that you wanted to pass the operand, too
Option Explicit Sub myFormlae2() Dim myRng As Range Dim myCell As Range Dim myVal As String myVal = InputBox(Prompt:="Enter a String") If Trim(myVal) = "" Then Exit Sub 'user hit cancel End If Set myRng = Selection For Each myCell In myRng.Cells With myCell If .HasFormula Then .Formula = "=(" & Mid(.Formula, 2) & ")" & myVal Else .Formula = "=" & .Formula & myVal End If End With Next myCell End Sub Don't put the equal sign. ian123 wrote: I'm entering "=+1" into the input box (for example). This simply returns the value 1 to the selected cell rather than apply +1 to the value already in the cell. Any ideas where i'm going wrong? --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Applying Formulae to a worksheet which are hidden | New Users to Excel | |||
Formulae: Paste value formulae after doing an average operation | Excel Discussion (Misc queries) | |||
Applying Logic | Excel Discussion (Misc queries) | |||
Searching TEXT in formulae, rather than results of formulae | Excel Worksheet Functions | |||
Applying formulae to cells??? | Excel Programming |