Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Cell Value in one sheet using SUM formula in another

Am using code below to loop through worksheets in workbook. Objective
is to place value in cell where that value is determined by the sum of
a range of cells on another sheet.

My current code is:

For Each sh In ThisWorkbook.Worksheets
If sh.Name "000" Then
Last = LastRow(DestSh)
DestSh.Cells(Last + 1, "A").Value = sh.Name
DestSh.Cells(Last + 1, "C").Value = _
sh.Range("E46").Value + sh.Range("F46").Value + sh.Range("G46").Value
DestSh.Cells(Last + 1, "D").Value = _
sh.Range("H46").Value + sh.Range("F46").Value
End If
Next

Instead of:
DestSh.Cells(Last + 1, "C").Value = sh.Range("E46").Value + _
sh.Range("F46").Value + sh.Range("G46").Value

I would like DestSh.Cells(Last + 1, "C").Value = SUM("E46:G46") on sh.

Thanks In Advance...

Mike

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Cell Value in one sheet using SUM formula in another

DestSh.Cells(Last + 1, "C").Value = Application.SUM(sh.Range("E46:G46"))

--
Regards,
Tom Ogilvy


"Mike" wrote in message
ups.com...
Am using code below to loop through worksheets in workbook. Objective
is to place value in cell where that value is determined by the sum of
a range of cells on another sheet.

My current code is:

For Each sh In ThisWorkbook.Worksheets
If sh.Name "000" Then
Last = LastRow(DestSh)
DestSh.Cells(Last + 1, "A").Value = sh.Name
DestSh.Cells(Last + 1, "C").Value = _
sh.Range("E46").Value + sh.Range("F46").Value + sh.Range("G46").Value
DestSh.Cells(Last + 1, "D").Value = _
sh.Range("H46").Value + sh.Range("F46").Value
End If
Next

Instead of:
DestSh.Cells(Last + 1, "C").Value = sh.Range("E46").Value + _
sh.Range("F46").Value + sh.Range("G46").Value

I would like DestSh.Cells(Last + 1, "C").Value = SUM("E46:G46") on sh.

Thanks In Advance...

Mike



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Cell Value in one sheet using SUM formula in another

Tom....many thanks. Wish I could meet you someday...kind regards

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
copy a sum in cell on sheet 1 (not formula) to cell on sheet 2 John Excel Worksheet Functions 1 March 2nd 09 12:01 AM
copy a sum in cell on sheet 1 (not formula) to cell on sheet 2 Eduardo Excel Worksheet Functions 0 February 27th 09 05:19 PM
Can I annotate a formula result in Sheet 1 in Sheet 2 by Cell Addr Rebecca Bauer Excel Worksheet Functions 2 August 27th 07 07:20 PM
how to copy a cell with formula from sheet 1 (data is all vertical) into sheet 2 parag Excel Worksheet Functions 3 June 15th 06 10:29 PM
Lookup cell contents in on sheet based on a formula in second sheet Michael Wright via OfficeKB.com Excel Worksheet Functions 1 April 30th 05 04:11 PM


All times are GMT +1. The time now is 06:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"