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: 127
Default Trouble with Formula in Cell

Excel 2003. I have code that places within the cell of a "wrap" sheet the
sum of the same cell in all of the other sheets in the workbook. The code
worked fine until I ran into the following case:

The Code:

For Each c In Sh.Range("B9:G32")
If c.Value < "" Then
MyFormula = "=SUM('" & Sheets(1).Name & ":" & _
Sheets(Lastsheet).Name & "'!" & c.Address & ")"
c.Formula = MyFormula
c.Font.Size = 8
End If
Next

THE PROBLEM:

The line

c.Formula = MyFormula

bombs when MyFormula is:

=SUM('004-Prince George's County, MD:070-Washington, PA'!$B$9)

I know the problem is the apostrophe in George's. What other delimiter can
I use in the SUM besides an apostrophe? Or in what other way may I refer to
the first through the nTH sheet of the workbook without using the sheet
names? THANKS FOR THE HELP. God bless.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
 
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
Formula Trouble Nrupesh Excel Discussion (Misc queries) 5 July 27th 08 03:17 PM
formula, with constant cell, trouble with fill down Municorn1977 Excel Discussion (Misc queries) 4 March 3rd 08 09:36 PM
formula trouble, dependent cell IrishGiant Excel Discussion (Misc queries) 1 August 7th 07 07:51 PM
Trouble with formula Keith Excel Discussion (Misc queries) 10 May 22nd 05 11:33 PM
Formula Trouble JS Excel Worksheet Functions 7 March 24th 05 06:55 PM


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