Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default macro to expdite editing cell

I posted this once but not shwoing up after atleast an hour

I have a number in a cell I need to edit the cell by going
in and adding an = sign in front of the original number,
placing a plus just after the original number , then
entering a new number

so original cell might look like 5.734

then need to add 4.375

I need to keep both numbers so need to do calc but want to
cut down on key strokes

when done needs to read =5.734+4.375 ( a simple calc
giving me the sum of the 2 numbers in the cell

The goal is tohave a short cut key to add an = sign to the
left of a single number then jump to the right of it, add
a plus sign, and give me a blinking cursor to type in my
number I want to add to the back of it.

Thanks much

Todd


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default macro to expdite editing cell

Watch for linewrap.

Sub CreateFormula()
Dim dblNum As Double, dblAdd As Double

dblNum = ActiveCell.Value
dblAdd = Application.InputBox("Please enter the number to add.",
Type:=2)
ActiveCell.Formula = "= " & dblNum & "+" & dblAdd & ""

End Sub


Tested using Excel 97SR2 on Windows 98SE,

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------
I posted this once but not shwoing up after atleast an hour

I have a number in a cell I need to edit the cell by going
in and adding an = sign in front of the original number,
placing a plus just after the original number , then
entering a new number

so original cell might look like 5.734

then need to add 4.375

I need to keep both numbers so need to do calc but want to
cut down on key strokes

when done needs to read =5.734+4.375 ( a simple calc
giving me the sum of the 2 numbers in the cell

The goal is tohave a short cut key to add an = sign to the
left of a single number then jump to the right of it, add
a plus sign, and give me a blinking cursor to type in my
number I want to add to the back of it.

Thanks much

Todd


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default macro to expdite editing cell

I gave you an answer.

"todd" wrote in message
...
I posted this once but not shwoing up after atleast an hour

I have a number in a cell I need to edit the cell by going
in and adding an = sign in front of the original number,
placing a plus just after the original number , then
entering a new number

so original cell might look like 5.734

then need to add 4.375

I need to keep both numbers so need to do calc but want to
cut down on key strokes

when done needs to read =5.734+4.375 ( a simple calc
giving me the sum of the 2 numbers in the cell

The goal is tohave a short cut key to add an = sign to the
left of a single number then jump to the right of it, add
a plus sign, and give me a blinking cursor to type in my
number I want to add to the back of it.

Thanks much

Todd




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default macro to expdite editing cell

This is a totally different question - I used your macro
for my other question - it is great!
-----Original Message-----
I gave you an answer.

"todd" wrote in message
...
I posted this once but not shwoing up after atleast an

hour

I have a number in a cell I need to edit the cell by

going
in and adding an = sign in front of the original number,
placing a plus just after the original number , then
entering a new number

so original cell might look like 5.734

then need to add 4.375

I need to keep both numbers so need to do calc but want

to
cut down on key strokes

when done needs to read =5.734+4.375 ( a simple calc
giving me the sum of the 2 numbers in the cell

The goal is tohave a short cut key to add an = sign to

the
left of a single number then jump to the right of it,

add
a plus sign, and give me a blinking cursor to type in my
number I want to add to the back of it.

Thanks much

Todd




.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default macro to expdite editing cell

thanks I will try
-----Original Message-----
Watch for linewrap.

Sub CreateFormula()
Dim dblNum As Double, dblAdd As Double

dblNum = ActiveCell.Value
dblAdd = Application.InputBox("Please enter the

number to add.",
Type:=2)
ActiveCell.Formula = "= " & dblNum & "+" & dblAdd & ""

End Sub


Tested using Excel 97SR2 on Windows 98SE,

HTH
Paul
----------------------------------------------------------

----------------------------------------------------
Be advised to back up your WorkBook before attempting to

make changes.
----------------------------------------------------------

----------------------------------------------------
I posted this once but not shwoing up after atleast an

hour

I have a number in a cell I need to edit the cell by

going
in and adding an = sign in front of the original number,
placing a plus just after the original number , then
entering a new number

so original cell might look like 5.734

then need to add 4.375

I need to keep both numbers so need to do calc but want

to
cut down on key strokes

when done needs to read =5.734+4.375 ( a simple calc
giving me the sum of the 2 numbers in the cell

The goal is tohave a short cut key to add an = sign to

the
left of a single number then jump to the right of it,

add
a plus sign, and give me a blinking cursor to type in my
number I want to add to the back of it.

Thanks much

Todd


.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default macro to expdite editing cell

I ran it but ran into a snag

works fine if just have a single number in cell

but if have this "=47.25+4.375" & say add 4.5 to it

it puts this in cell

= 51.625+4.5 It is adding the two original numbers
together then adding my new number to the back of it

I probably did not clarify

if I have 47.25+4.375 already in cell and want to add 4.5
to it then when done that action I need the cell to have
the following in it:

"=47.25+4.375+4.5

In the cell to start with I may have one number or there
may be up to 3 or 4 numbers added together with + signs
between them.

Thanks








-----Original Message-----
Watch for linewrap.

Sub CreateFormula()
Dim dblNum As Double, dblAdd As Double

dblNum = ActiveCell.Value
dblAdd = Application.InputBox("Please enter the

number to add.",
Type:=2)
ActiveCell.Formula = "= " & dblNum & "+" & dblAdd & ""

End Sub


Tested using Excel 97SR2 on Windows 98SE,

HTH
Paul
----------------------------------------------------------

----------------------------------------------------
Be advised to back up your WorkBook before attempting to

make changes.
----------------------------------------------------------

----------------------------------------------------
I posted this once but not shwoing up after atleast an

hour

I have a number in a cell I need to edit the cell by

going
in and adding an = sign in front of the original number,
placing a plus just after the original number , then
entering a new number

so original cell might look like 5.734

then need to add 4.375

I need to keep both numbers so need to do calc but want

to
cut down on key strokes

when done needs to read =5.734+4.375 ( a simple calc
giving me the sum of the 2 numbers in the cell

The goal is tohave a short cut key to add an = sign to

the
left of a single number then jump to the right of it,

add
a plus sign, and give me a blinking cursor to type in my
number I want to add to the back of it.

Thanks much

Todd


.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default macro to expdite editing cell

Try me.

Sub CreateFormula()
Dim dblNum As Double, dblAdd As Double

dblAdd = Application.InputBox("Please enter the number to add.",
Type:=2)

If Not ActiveCell.HasFormula Then
dblNum = ActiveCell.Value
ActiveCell.Formula = "= " & dblNum & "+" & dblAdd & ""
Else
ActiveCell.Formula = ActiveCell.Formula & "+" & dblAdd
End If

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

I ran it but ran into a snag

works fine if just have a single number in cell

but if have this "=47.25+4.375" & say add 4.5 to it

it puts this in cell

= 51.625+4.5 It is adding the two original numbers
together then adding my new number to the back of it

I probably did not clarify

if I have 47.25+4.375 already in cell and want to add 4.5
to it then when done that action I need the cell to have
the following in it:

"=47.25+4.375+4.5

In the cell to start with I may have one number or there
may be up to 3 or 4 numbers added together with + signs
between them.

Thanks


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default macro to expdite editing cell

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim sForm as String, sVal as String
On Error GoTo ErrHandler
If Target.Count 1 Then Exit Sub
If Target.Column = 1 Then
sVal = Target.Value
If sVal = "" Then Exit Sub
Application.EnableEvents = False
Application.Undo
sForm = Target.Formula
If Left(sForm, 1) < "=" Then _
sForm = "=" & sForm
sForm = sForm & "+" & sVal
Target.Formula = sForm
End If
ErrHandler:
Application.EnableEvents = True
End Sub

Right click on the sheet tab and paste in the code.

Now start typing numbers into column A.

Just overtype any existing number and it will build your formula.

--
regards,
Tom Ogilvy

todd wrote in message
...
I posted this once but not shwoing up after atleast an hour

I have a number in a cell I need to edit the cell by going
in and adding an = sign in front of the original number,
placing a plus just after the original number , then
entering a new number

so original cell might look like 5.734

then need to add 4.375

I need to keep both numbers so need to do calc but want to
cut down on key strokes

when done needs to read =5.734+4.375 ( a simple calc
giving me the sum of the 2 numbers in the cell

The goal is tohave a short cut key to add an = sign to the
left of a single number then jump to the right of it, add
a plus sign, and give me a blinking cursor to type in my
number I want to add to the back of it.

Thanks much

Todd




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default fantastic but column question

This line checks for column A:
If Target.Column = 1 Then

If Target.Column = 2 Then
would check for B.

Do you mean that you want it to work on either A, B or C?
If target.column < 4 then

todd wrote:

Thanks I could not wait and plugged it in.

If need be I can work with it in column A but I am
wondering if there is a poiojnt in the coode where I can
modify it to work in say for example column B or Column C.

TOdd Frisch

Anyway this is very cool - I appreciate your time.
-----Original Message-----
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim sForm as String, sVal as String
On Error GoTo ErrHandler
If Target.Count 1 Then Exit Sub
If Target.Column = 1 Then
sVal = Target.Value
If sVal = "" Then Exit Sub
Application.EnableEvents = False
Application.Undo
sForm = Target.Formula
If Left(sForm, 1) < "=" Then _
sForm = "=" & sForm
sForm = sForm & "+" & sVal
Target.Formula = sForm
End If
ErrHandler:
Application.EnableEvents = True
End Sub

Right click on the sheet tab and paste in the code.

Now start typing numbers into column A.

Just overtype any existing number and it will build your

formula.

--
regards,
Tom Ogilvy

todd wrote in message
...
I posted this once but not shwoing up after atleast an

hour

I have a number in a cell I need to edit the cell by

going
in and adding an = sign in front of the original number,
placing a plus just after the original number , then
entering a new number

so original cell might look like 5.734

then need to add 4.375

I need to keep both numbers so need to do calc but want

to
cut down on key strokes

when done needs to read =5.734+4.375 ( a simple calc
giving me the sum of the 2 numbers in the cell

The goal is tohave a short cut key to add an = sign to

the
left of a single number then jump to the right of it,

add
a plus sign, and give me a blinking cursor to type in my
number I want to add to the back of it.

Thanks much

Todd




.


--

Dave Peterson

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default yes that's it

The issue is my working column or target column will not
always be in A sometimes B or C

thanks will use this
-----Original Message-----
This line checks for column A:
If Target.Column = 1 Then

If Target.Column = 2 Then
would check for B.

Do you mean that you want it to work on either A, B or C?
If target.column < 4 then

todd wrote:

Thanks I could not wait and plugged it in.

If need be I can work with it in column A but I am
wondering if there is a poiojnt in the coode where I can
modify it to work in say for example column B or Column

C.

TOdd Frisch

Anyway this is very cool - I appreciate your time.
-----Original Message-----
Private Sub Worksheet_Change(ByVal Target As

Excel.Range)
Dim sForm as String, sVal as String
On Error GoTo ErrHandler
If Target.Count 1 Then Exit Sub
If Target.Column = 1 Then
sVal = Target.Value
If sVal = "" Then Exit Sub
Application.EnableEvents = False
Application.Undo
sForm = Target.Formula
If Left(sForm, 1) < "=" Then _
sForm = "=" & sForm
sForm = sForm & "+" & sVal
Target.Formula = sForm
End If
ErrHandler:
Application.EnableEvents = True
End Sub

Right click on the sheet tab and paste in the code.

Now start typing numbers into column A.

Just overtype any existing number and it will build

your
formula.

--
regards,
Tom Ogilvy

todd wrote in message
...
I posted this once but not shwoing up after atleast

an
hour

I have a number in a cell I need to edit the cell by

going
in and adding an = sign in front of the original

number,
placing a plus just after the original number , then
entering a new number

so original cell might look like 5.734

then need to add 4.375

I need to keep both numbers so need to do calc but

want
to
cut down on key strokes

when done needs to read =5.734+4.375 ( a simple calc
giving me the sum of the 2 numbers in the cell

The goal is tohave a short cut key to add an = sign

to
the
left of a single number then jump to the right of it,

add
a plus sign, and give me a blinking cursor to type

in my
number I want to add to the back of it.

Thanks much

Todd




.


--

Dave Peterson

.

Reply
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
Macro Editing Doug B[_2_] New Users to Excel 4 May 15th 09 09:11 PM
Editing a macro Dtmos01 Excel Discussion (Misc queries) 6 April 3rd 07 06:36 PM
in cell editing macro ynissel Excel Discussion (Misc queries) 2 July 27th 05 07:28 PM
Macro: How to avoid cell value editing ? keepitcool Excel Programming 1 August 13th 03 05:32 AM
Cell Editing Macro styler Excel Programming 1 July 31st 03 06:48 PM


All times are GMT +1. The time now is 12:36 PM.

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"