View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default is this vba code correct or is there a more simple way to do this ?

Jean-Pierre,
Something like:

Dim i As Long

With Sheets("staffelberekening")
.Range("I27").Value =
Application.WorksheetFunction.Sum(Sheets("toekomst _oud").Columns("P:P")) +
..Range("D12") + .Range("D13")
For i = 0 To 5
.Range("I27").Offset(i, 0).Value =
Application.WorksheetFunction.Sum(Sheets("toekomst _oud").Columns(28 + i *
4)) + .Range("D12") + .Range("D13")
Next
End With

I assume the jump from Column "P" to "AB" is intentional.

NickHK

"Jean-Pierre D via OfficeKB.com" wrote in message
...
Hi NickHK,
the ranges Range("D12") + Range("D13") refer to

sheets("staffelberekening")
The code is in the object sheet1(staffelberekening) under workbook

'selection
change'



NickHK wrote:
Jean-Pierre,
Which sheets do the ranges Range("D12") + Range("D13") refer to ?

NickHk

Hi,

[quoted text clipped - 18 lines]
Thanks,
Jean-Pierre



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200508/1