LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Range and SUM of 3 cells

Okay Bob,

Many thanks for your help.

Ole


"Bob Phillips" skrev i en meddelelse
...
Lost me I am afraid.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ole_" wrote in message
...
Okay, when i multipli twice its copied to row F, when i multipli three

times
its copied to Row G
and so on, and i need them all, when i run this macro Row F to Row P and
cell *11, *14, *17, *20, *23, *26
*29, *32, *35, *38, *41 is all filled out.
Can i still use the "SumData multiplier" ?

Ole


"Bob Phillips" skrev i en meddelelse
...
No it isn't the same, it achieves the same result without you having

to
replicate the code over and over for the different multipliers (which

I
still don't understand how you know when it is twice, when three times
etc.).

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ole_" wrote in message
...
Is it me or isn't that the same, i am not sure i understand what you

mean?


"Bob Phillips" skrev i en

meddelelse
...
Yes put the code in a separate sub and call it with a multiplier
parameter

SumData multiplier:=1
.... more code
SumData multiplier:=2
.... more code
SumData multiplier:=3
... more code

etc

Sub SumData(multiplier As Long)
With Worksheets(2)
bk.Worksheets(1).Range("F11").Value = _
.Range("F38").Value + (Range("F41").Value) * multiplier
'kopier 1-4 farver 2 design
bk.Worksheets(1).Range("F14").Value = _
.Range("G38").Value + (.Range("G41").Value) *

multiplier
bk.Worksheets(1).Range("F17").Value = _
.Range("H38").Value + (.Range("H41").Value) *

multiplier
bk.Worksheets(1).Range("F20").Value = _
.Range("I38").Value + (.Range("I41").Value) *

multiplier
bk.Worksheets(1).Range("F23").Value = _
.Range("J38").Value + (.Range("J41").Value) *

multiplier
bk.Worksheets(1).Range("F26").Value = _
.Range("K38").Value + (.Range("K41").Value) *

multiplier
bk.Worksheets(1).Range("F29").Value = _
.Range("L38").Value + (.Range("L41").Value) *

multiplier
bk.Worksheets(1).Range("F32").Value = _
.Range("M38").Value + (.Range("M41").Value) *

multiplier
bk.Worksheets(1).Range("F35").Value = _
.Range("N38").Value + (.Range("N41").Value) *

multiplier
bk.Worksheets(1).Range("F38").Value = _
.Range("O38").Value + (.Range("O41").Value) *

multiplier
bk.Worksheets(1).Range("F41").Value = _
.Range("P38").Value + (.Range("P41").Value) *

multiplier
' 1-42 design hertil
End With
End Sub







 
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
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
how to compute a range of cells based on another range of cells? HAROLD Excel Worksheet Functions 1 December 30th 05 09:32 PM
how to compute a range of cells based on another range of cells? HAROLD Excel Worksheet Functions 2 December 30th 05 07:55 PM
Count cells in one range based on parameters in another range dave roth Excel Worksheet Functions 2 March 29th 05 05:33 PM
Copy a formula to a range of cells via VB6 using .Range(Cells(row,col), Cells(row,col)).Formula= statement Kevin Excel Programming 7 October 5th 04 08:11 PM


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