Multiplication over and over given the column spacing

DianChris

New Member
Joined
Sep 29, 2020
Messages
5
Office Version
  1. 2013
Platform
  1. Windows
Hello ,
I have data like the table below
can you please give me a sample script for that data,
and this data will repeat like this (right column)

Please help and thanks
?
I also ask here


NoActivitiesPriceQuantity1ValueQuantity2ValuePendingValueOtherPriceQuantity1ValueQuantity2ValuePendingValueOther
1Bolt10000
25​
Result for C*D (250000)​
15​
Result for C*F (150000)​
10​
Result for C*H (100000)​
prices are different​
Repeat ( K*M)​
Repeat(K*0)​
Repeat(N-L)​
Repeat(K*P)​
2
etc​
etc​
etc​
etc​
etc​
etc​
TOTAL​
TOTAL​
TOTAL​
TOTAL​
TOTAL​
TOTAL​

[/TR]
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Sub Try()
Dim Sh As Worksheet, sel As Range
Set Sh = Sheets("Source")

On Error Resume Next
With Sh
For Each sel In .Range("C5:C48")

i = sel.Row
.Cells(i, 5).Value = .Cells(i, 3).Value * .Cells(i, 4).Value
.Cells(i, 7).Value = .Cells(i, 3).Value * .Cells(i, 6).Value
.Cells(i, 8).Value = .Cells(i, 6).Value - .Cells(i, 4).Value
.Cells(i, 9).Value = .Cells(i, 3).Value * .Cells(i, 8).Value
Next

End With

End Sub

I have made a script for multiplication, what should the next script do so that the next column follows the existing script?
 
Upvote 0
why is the column that I target to be 0
where is the script i need to fix

Sub Perkalian()
Dim Sh As Worksheet, sel As Range, a As Integer
Set Sh = Sheets("Source")

On Error Resume Next
With Sh
For x = 0 To 4
lct = x * 7
For Each sel In .Range("C5:C48")

i = sel.Row
.Cells(i, 5 + lct).Value = .Cells(i, 3 + lct).Value * .Cells(i, 4 + lct).Value
.Cells(i, 7 + lct).Value = .Cells(i, 3 + lct).Value * .Cells(i, 6 + lct).Value
.Cells(i, 8 + lct).Value = .Cells(i, 6 + lct).Value - .Cells(i, 4 + lct).Value
.Cells(i, 9 + lct).Value = .Cells(i, 3 + lct).Value * .Cells(i, 8 + lct).Value
Next sel
Next x
End With

End Sub

why is the column that I target to be 0
where is the script i need to fix
 
Upvote 0
1-min.JPG
 
Upvote 0

Forum statistics

Threads
1,214,942
Messages
6,122,367
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top