LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default run a macro wehn leaveing a cell ??

Hi

I have a same question and I guess you can help me out. I am not a VB
programmer but i know how to add code in Excel using VB

I want a formula to get copied uatomatically from the previous row when I
change/add a cell in column A of the worksheet.
What exactly I should write in VB worksheet function ?

Priya

"Nigel" wrote:

In the worksheet code add this (enter a new value in A1 and running total is
updated in B1
Change cells as required.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Range("B1") = Range("B1") + Target.Value
End If
End Sub

--
Cheers
Nigel



"Sparky AKA_Sparkticus" wrote in message
...
Can this be implemented or is there a vba way
i have to in put mileage and calculate total mileage dont want to input a
large list just use one entry point.

i have a sum which is

mileage + previous total = total

i have used a macro to copy new total to previous and move curser to
mileage
ready for a new input but is this the only way or can vab do this after
hitting enter on mileage??

Sparkyman












 
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
'IF' Macro to insert cell contents to alternate cell if cell not e Gryndar Excel Worksheet Functions 6 December 20th 08 05:02 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Excel Crash wehn print to PDF [email protected] Excel Discussion (Misc queries) 0 May 18th 06 05:53 PM
macro to run a separate macro dependent on value in cell scottwilsonx[_13_] Excel Programming 3 July 26th 04 02:30 PM
Question: Cell formula or macro to write result of one cell to another cell Frederik Romanov Excel Programming 1 July 8th 03 03:03 PM


All times are GMT +1. The time now is 12:50 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"