Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Code Question for Newbe

Scenario:
I have a worksheet that has Column A and Column B, each containing 10
rows of data, that need to be added together and their sum displayed in
column C.

I want to copy this formula in Column C 10 rows down.

I want to write a macro that will do this but I want the macro to be
able to do the same operation in a file that would have any number or
rows to be added. I do not want to have this formula copied to all the
rows in Column C. Just the rows that have data to be added.

How would I code this?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Macro Code Question for Newbe

There are many way to do that. Here's one:

Range("B1", Range("B1").End(xlDown)).Offset(0, 1).FillDown

--
Jim Rech
Excel MVP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Code Question for Newbe

Thanks, It worked exactly like I wanted it to.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

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
macro code question Maria Excel Discussion (Misc queries) 6 March 7th 09 08:44 AM
newbe with a formula question. David franklin Excel Discussion (Misc queries) 5 February 4th 08 06:03 AM
A macro code question from a novice Richard Excel Discussion (Misc queries) 2 December 24th 07 07:22 PM
Newbe trying to do Dynamic Parameters from a Worksheet Sean Cooper Excel Discussion (Misc queries) 0 January 22nd 07 02:56 PM
Newbe help with a lookup Cybertech Excel Discussion (Misc queries) 2 January 13th 06 09:53 PM


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