Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 386
Default Four macros, one main output

Hi,

I just wrote a message before about a delete macro but I thought I'd better
put both questions together now.

I have four macros on two different excel sheets all controlling a value in
the same cell. On sheet 1 I have two macros which either add or subtract 1
from cell I38 every time the button is pushed. On sheet 2 I have another two
macros which do the same thing - they add and subtract 1 from cell L6.

I need cell L6 from sheet 2 to update the value in sheet 1 cell I38 then
reset to zero, but maintain the value in cell I38 sheet 1.

Example:
- I hit +1 five times and -1 twice on sheet 1. My stock, (cell I38 sheet
1), goes from 20 to 23.
- I then hit +1 ten times and -1 once on sheet 2. Cell L6 on sheet 2 will
show that I have entered a total of 9 times.
- Cell L6 will then update cell I38 on sheet 1 from 23 to 32.
- Cell L6 sheet 2 will reset to zero and cell I38 sheet 1 will stay at 32
until the next update arrives.

Is this possible? I have attached the +1 macro i am using below for
reference - maybe i need something different to do all the operations I don't
know.

Thanks for your help

Sub Production15()
With Sheet2 ' Changer to suit
If Range("L6").Value < "" Then ' Change L6 to suit
Range("L6").Value = Range("L6").Value + 1
End If
End With
End Sub

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Four macros, one main output

On the sheet module for Sheet 2, paste this code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("L6") Then
Worksheets("Sheet 1").Range("I38").Value = Range("L6").Value +
Worksheets("Sheet 1").Range("I38").Value
'Note that preceding code should be 1 line
Range("L6").Value = 0
End If
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"LiAD" wrote:

Hi,

I just wrote a message before about a delete macro but I thought I'd better
put both questions together now.

I have four macros on two different excel sheets all controlling a value in
the same cell. On sheet 1 I have two macros which either add or subtract 1
from cell I38 every time the button is pushed. On sheet 2 I have another two
macros which do the same thing - they add and subtract 1 from cell L6.

I need cell L6 from sheet 2 to update the value in sheet 1 cell I38 then
reset to zero, but maintain the value in cell I38 sheet 1.

Example:
- I hit +1 five times and -1 twice on sheet 1. My stock, (cell I38 sheet
1), goes from 20 to 23.
- I then hit +1 ten times and -1 once on sheet 2. Cell L6 on sheet 2 will
show that I have entered a total of 9 times.
- Cell L6 will then update cell I38 on sheet 1 from 23 to 32.
- Cell L6 sheet 2 will reset to zero and cell I38 sheet 1 will stay at 32
until the next update arrives.

Is this possible? I have attached the +1 macro i am using below for
reference - maybe i need something different to do all the operations I don't
know.

Thanks for your help

Sub Production15()
With Sheet2 ' Changer to suit
If Range("L6").Value < "" Then ' Change L6 to suit
Range("L6").Value = Range("L6").Value + 1
End If
End With
End Sub

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 386
Default Four macros, one main output

HI,

Do i need to combine this with something else? I am getting compile errors
at the moment.

Also with this type of formula how can i name it so its easier to find in
the macro list? (what i called Production15() before)

Thanks for your help

"Luke M" wrote:

On the sheet module for Sheet 2, paste this code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("L6") Then
Worksheets("Sheet 1").Range("I38").Value = Range("L6").Value +
Worksheets("Sheet 1").Range("I38").Value
'Note that preceding code should be 1 line
Range("L6").Value = 0
End If
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"LiAD" wrote:

Hi,

I just wrote a message before about a delete macro but I thought I'd better
put both questions together now.

I have four macros on two different excel sheets all controlling a value in
the same cell. On sheet 1 I have two macros which either add or subtract 1
from cell I38 every time the button is pushed. On sheet 2 I have another two
macros which do the same thing - they add and subtract 1 from cell L6.

I need cell L6 from sheet 2 to update the value in sheet 1 cell I38 then
reset to zero, but maintain the value in cell I38 sheet 1.

Example:
- I hit +1 five times and -1 twice on sheet 1. My stock, (cell I38 sheet
1), goes from 20 to 23.
- I then hit +1 ten times and -1 once on sheet 2. Cell L6 on sheet 2 will
show that I have entered a total of 9 times.
- Cell L6 will then update cell I38 on sheet 1 from 23 to 32.
- Cell L6 sheet 2 will reset to zero and cell I38 sheet 1 will stay at 32
until the next update arrives.

Is this possible? I have attached the +1 macro i am using below for
reference - maybe i need something different to do all the operations I don't
know.

Thanks for your help

Sub Production15()
With Sheet2 ' Changer to suit
If Range("L6").Value < "" Then ' Change L6 to suit
Range("L6").Value = Range("L6").Value + 1
End If
End With
End Sub

Thanks

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
Main history of car insurance phoplevet Excel Discussion (Misc queries) 0 October 27th 08 02:15 AM
I've lost a main column 5jays217 Excel Discussion (Misc queries) 1 June 28th 06 08:06 PM
Main and subject spreadsheets Mark D. Brown, MSW Setting up and Configuration of Excel 2 December 30th 05 02:57 PM
Main menu is missing Deb G Excel Discussion (Misc queries) 3 May 10th 05 07:46 PM
Can macros output to a cell selected prior to running it? winnie Excel Worksheet Functions 3 February 17th 05 11:03 PM


All times are GMT +1. The time now is 03:32 PM.

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"