Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple Macro


Hello,
I am a beginner with macros, so please bear with me. I need to write a
simple macro for a sheet in order to simplify a repetitive task. I have
2 columns, each with a dollar amount that gets added to a new cell each
day by one user. At another point in the day, a different user
accesses the sheet and needs to add an amount to one column and then
have that amount subtracted from the column that the first user
entered. She goes in and does this manually multiple times a day every
day. I tried to record a macro to do it but it I can't get it to do
what I want. So I tried to edit the macro to my needs an it spits out
an error which I'm sure is due to my lack of VB knowledge. Here is the
recorded macro:
Sub Macro4()
'
' Macro4 Macro
' Macro recorded 3/21/2006 by simoro
'

'
ActiveCell.FormulaR1C1 = "=35246.15-RC[1]"
Range("E25").Select
End Sub
Obviously it's very simple. Can anyone help?


--
brownl
------------------------------------------------------------------------
brownl's Profile: http://www.excelforum.com/member.php...o&userid=32800
View this thread: http://www.excelforum.com/showthread...hreadid=526219

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Simple Macro

right click sheet tabview codeinsert thischange column to fit. Now when
the 2nd user enters data in col 7 (or yours) then col 8 will show col 6-col
7.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 7 Then Exit Sub
Target.Offset(, 1) = Target.Offset(, -1) - Target
End Sub


--
Don Guillett
SalesAid Software

"brownl" wrote in
message ...

Hello,
I am a beginner with macros, so please bear with me. I need to write a
simple macro for a sheet in order to simplify a repetitive task. I have
2 columns, each with a dollar amount that gets added to a new cell each
day by one user. At another point in the day, a different user
accesses the sheet and needs to add an amount to one column and then
have that amount subtracted from the column that the first user
entered. She goes in and does this manually multiple times a day every
day. I tried to record a macro to do it but it I can't get it to do
what I want. So I tried to edit the macro to my needs an it spits out
an error which I'm sure is due to my lack of VB knowledge. Here is the
recorded macro:
Sub Macro4()
'
' Macro4 Macro
' Macro recorded 3/21/2006 by simoro
'

'
ActiveCell.FormulaR1C1 = "=35246.15-RC[1]"
Range("E25").Select
End Sub
Obviously it's very simple. Can anyone help?


--
brownl
------------------------------------------------------------------------
brownl's Profile:
http://www.excelforum.com/member.php...o&userid=32800
View this thread: http://www.excelforum.com/showthread...hreadid=526219



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Simple Macro

Why don't you use a formula, instead of a macro ?
In column-A an amount is entered by user-A, in column-B another user enters
another value, in column-C you have a formula, that goes:
=IF(B2="","",A2-B2)
You pull that down as far as you wish.
As soon as she enters something into the cell in col-B the result will show
up in col-C.
Do I get the point right?
Gábor

"brownl" az alábbiakat
írta a következő hírüzenetben:
...

Hello,
I am a beginner with macros, so please bear with me. I need to write a
simple macro for a sheet in order to simplify a repetitive task. I have
2 columns, each with a dollar amount that gets added to a new cell each
day by one user. At another point in the day, a different user
accesses the sheet and needs to add an amount to one column and then
have that amount subtracted from the column that the first user
entered. She goes in and does this manually multiple times a day every
day. I tried to record a macro to do it but it I can't get it to do
what I want. So I tried to edit the macro to my needs an it spits out
an error which I'm sure is due to my lack of VB knowledge. Here is the
recorded macro:
Sub Macro4()
'
' Macro4 Macro
' Macro recorded 3/21/2006 by simoro
'

'
ActiveCell.FormulaR1C1 = "=35246.15-RC[1]"
Range("E25").Select
End Sub
Obviously it's very simple. Can anyone help?


--
brownl
------------------------------------------------------------------------
brownl's Profile:
http://www.excelforum.com/member.php...o&userid=32800
View this thread: http://www.excelforum.com/showthread...hreadid=526219



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
Simple Macro John Excel Worksheet Functions 1 November 17th 06 05:16 PM
Simple Macro MAStew New Users to Excel 3 July 27th 06 10:50 PM
Need help with simple macro garlnnd Excel Programming 4 October 5th 05 07:22 PM
Simple macro help lars Excel Programming 1 March 5th 05 05:16 PM
Simple Macro (I think) Jason Excel Programming 4 September 9th 04 02:54 AM


All times are GMT +1. The time now is 07:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"