LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default formula in VB not working

I have several columns of figures with totals at the bottom. The leftmost
column is the grand total. I need to calculate what percentages the subtotals
are of the grand total.
This code sums the column, and works fine:
Dim per1 As String
per1 = "=sum(" & r3 & ":" & r4 & ")"
ActiveCell.formula = per1

This code 'should' calculate the percentage, but the debugger sticks on the
final line:
Dim per2 As String
per2 = "=sum(" & r3 & ":" & r4 & ")/(=sum(" & r1 & ":" & r2 & ")/100)"
ActiveCell.formula = per2

What have I done?
 
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
A formula not working as the result of a previous formula? Ed[_7_] Excel Discussion (Misc queries) 5 July 21st 09 06:22 PM
Formula not working, help SunshineinFt.Myers[_2_] Excel Worksheet Functions 3 March 11th 09 08:58 PM
formula not working JayPee New Users to Excel 2 August 8th 08 10:22 PM
IF Formula Not Working novice Excel Worksheet Functions 4 July 31st 08 11:54 PM
Formula not working Carolina Girl Excel Worksheet Functions 4 May 16th 08 05:26 PM


All times are GMT +1. The time now is 07:03 AM.

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"