Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Subtract named cells

Hi,

Please can somebody help me with the formula for named cells

Partial code.........

Set Exp6 = Cells(H, 3)
Set Exp7 = Cells(I, 7)


ActiveCell.Offset(0, 1).Formula = "=exp6-exp7"

I just get #Name?

Thanks

Darren

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200706/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 163
Default Subtract named cells

hmm...

Do you mean something like this:

Sub test()
Dim Exp6 As Range
Dim Exp7 As Range
Set Exp6 = Cells(1, 1)
Set Exp7 = Cells(1, 2)
ActiveCell.Offset(0, 1).Formula = "=sum(Exp6-Exp7)"
End Sub

--

Helmut Weber

Win XP, Office 2003

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 163
Default Subtract named cells

"Sum" is not required

ActiveCell.Offset(0, 1).Formula = "=Exp6-Exp7"

--

Helmut Weber

Win XP, Office 2003

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Subtract named cells

Cells(3,"H").name = "exp6"
Cells(7,"I").Name = "exp7"
ActiveCell.Offset(0, 1).Formula = "=exp6-exp7"

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"FIRSTROUNDKO via OfficeKB.com" <u15639@uwe wrote in message
news:7395be8a4cb7b@uwe...
Hi,

Please can somebody help me with the formula for named cells

Partial code.........

Set Exp6 = Cells(H, 3)
Set Exp7 = Cells(I, 7)


ActiveCell.Offset(0, 1).Formula = "=exp6-exp7"

I just get #Name?

Thanks

Darren

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200706/1




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Subtract named cells

Thanks for everybodys help.

Change of plan I think im going to show Exp6 and Exp7 then do the subtraction


Bob Phillips wrote:
Cells(3,"H").name = "exp6"
Cells(7,"I").Name = "exp7"
ActiveCell.Offset(0, 1).Formula = "=exp6-exp7"

Hi,

[quoted text clipped - 12 lines]

Darren


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200706/1

Reply
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
subtract 2 cells and get blank instead of 0.0 tpeter Excel Worksheet Functions 3 September 8th 08 07:53 PM
How do I make cells subtract? Robert[_3_] Excel Worksheet Functions 3 July 18th 07 11:40 PM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
How can I subtract cells in a row wildfyre New Users to Excel 3 February 14th 06 07:26 PM
how to add or subtract from two cells into one labjr1231 Excel Worksheet Functions 2 September 6th 05 06:40 AM


All times are GMT +1. The time now is 07:06 PM.

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"