If i can get Formula Sytanx right for summing then why not for....

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
660
Anyone who can help me to correct
If i can get Formula Sytanx right for summing

Sheet4.Cells(TotRow, 8).Formula = "=Sum(C" & fRow & ":C" & lRow & ")" as =SUM(C2:C5) in a Cell
then why not for the following
Sheet4.Cells(TotRow, 10).Formula = "=" & Sheet4.Cells(TotRow, 8).Value * Sheet4.Cells(TotRow, 3) / 100)
I am getting as =Figure and not as =H5*H3/100 in the cell
Thanks
NimishK
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,517
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Untested, but I thiunk you need

"
Code:
=Sheet4!H" & TotRow & "*Sheet4!H" & TotRow & " / 100)"

but that doesn't equate to H5*H3/100....I'm guessing you will be able to mdify as required
 
Upvote 0

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,517
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
ooops, sorry
Code:
.Formula = "=Sheet4!H" & totrow & "*Sheet4!H" & totrow & " / 100"
 
Upvote 0

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
660
Sorry Michael It did not work. Hope you had tried too

By the way if i defined

wS as Worksheet then how would the syntax be for Following
Dim wS as Worksheet
Set wS = Sheets("Sheet4")
ws.Cells(TotRow, 10).Formula = "=" & ws.Cells(TotRow, 8).Value * ws.Cells(TotRow, 3) / 100)
 
Last edited:
Upvote 0

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
38,136
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
By the way if i defined

wS as Worksheet then how would the syntax be for Following
Code:
Dim wS as Worksheet
Set wS = Sheets("Sheet4")
ws.Cells(TotRow, 10).Formula = "=" & ws.Cells(TotRow, 8).Value * ws.Cells(TotRow, 3) / 100)
Try it like this...
Code:
[table="width: 500"]
[tr]
	[td]  Dim wS As Worksheet
  Dim TotRow As Long
  Set wS = Sheets("Sheet4")
  TotRow = 9
  wS.Cells(TotRow, 10).Formula = "=" & wS.Cells(TotRow, 8).Address(0, 0) & "*" & wS.Cells(TotRow, 3).Address(0, 0) & "/100"[/td]
[/tr]
[/table]
 
Upvote 0

Forum statistics

Threads
1,186,877
Messages
5,960,372
Members
438,472
Latest member
Nate J

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
Top