Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
When entering data into a range of cells, select the entire range. | Excel Discussion (Misc queries) | |||
how to compute a range of cells based on another range of cells? | Excel Worksheet Functions | |||
how to compute a range of cells based on another range of cells? | Excel Worksheet Functions | |||
Count cells in one range based on parameters in another range | Excel Worksheet Functions | |||
Copy a formula to a range of cells via VB6 using .Range(Cells(row,col), Cells(row,col)).Formula= statement | Excel Programming |