Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default macro to sum with offset in 2 cell as other cell changed

I need to create macro with this scenario:
F - quantity
H - 1 serial
I - 2 serial
For example some cells:

H644 =SUM(I643+1)
I644 =SUM(I643+F644)
So when I put some number in cell F644, sums correctly calculated,
then one by one cell as i enter some in F

Thank you.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default macro to sum with offset in 2 cell as other cell changed

is this macro correct for this operation?


Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("F:F")) Is Nothing Then
With Target
If .Value < "" Then
..Offset(0, 2).Value = Cells(Target.Row - 1, 9) + 1
..Offset(0, 3).Value = Cells(Target.Row - 1, 9) + Cells(Target.Row, 6)
..Offset(0, 6).Value = Format(Now, "yymmdd")
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub
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
run macro whenever any cell is changed bob engler Excel Programming 1 November 11th 07 03:40 AM
Run a macro when a cell is changed by an outside source Jon[_21_] Excel Programming 3 November 9th 05 06:26 PM
Run Macro when particular cell is changed? Dr.Ile Excel Programming 0 November 2nd 04 09:30 AM
Run Macro when particular cell is changed? mangesh_yadav[_153_] Excel Programming 0 November 2nd 04 09:21 AM
Run an excel macro when a cell value is changed VonnerNIX[_3_] Excel Programming 0 September 28th 04 02:17 PM


All times are GMT +1. The time now is 04:28 AM.

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"