Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Help to create a macro

Hi,

I need to create a macro that calculates a value based on several values in
a range. The result from the calculations shuld be copied into a new column
with the same range. I have tried to record this operation but I need help to
make the macro repeat the operations throug the range. I have pasted the code
from my recorded macro:

Range("B2").Select
ActiveCell.FormulaR1C1 = "=R[1]C[8]"
Range("C4").Select
ActiveCell.FormulaR1C1 = "=R[-1]C[6]"
Range("K3").Select
ActiveCell.FormulaR1C1 = "=R[11]C[-9]"
Range("L3").Select
ActiveCell.FormulaR1C1 = "=R[8]C[-10]"
End sub

I copy values from J3:J39 to be used in B2. Then I copy values from I3:I39
to be used in C4. From this i get two results that i want to be copied to new
columns in the same range. The results is genereted in cells B11 and B14, and
is copied into the range K3:K39 and L3:L39.

Thank you

Cornelius
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Help to create a macro

.. I copy values from J3:J39 to be used in B2 ..
Be more specific on this. Say it in a different way. Dave D-C

Cornelius wrote:
Hi,

I need to create a macro that calculates a value based on several values in
a range. The result from the calculations shuld be copied into a new column
with the same range. I have tried to record this operation but I need help to
make the macro repeat the operations throug the range. I have pasted the code
from my recorded macro:

Range("B2").Select
ActiveCell.FormulaR1C1 = "=R[1]C[8]"
Range("C4").Select
ActiveCell.FormulaR1C1 = "=R[-1]C[6]"
Range("K3").Select
ActiveCell.FormulaR1C1 = "=R[11]C[-9]"
Range("L3").Select
ActiveCell.FormulaR1C1 = "=R[8]C[-10]"
End sub

I copy values from J3:J39 to be used in B2. Then I copy values from I3:I39
to be used in C4. From this i get two results that i want to be copied to new
columns in the same range. The results is genereted in cells B11 and B14, and
is copied into the range K3:K39 and L3:L39.

Thank you

Cornelius




----== Posted via Pronews.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.pronews.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= - Total Privacy via Encryption =---
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
Create a macro to create excel line graph with coloured pointers anddata lables anuj datta Charts and Charting in Excel 1 September 30th 09 04:04 PM
Create WB, create new Sht, paste data. (Macro not working) Rick S. Excel Programming 6 October 31st 07 05:33 PM
create Macro €“ select data, sort by acc no., yr, part no, create P Johnny Excel Programming 0 November 22nd 06 03:18 PM
Using a macro to create a macro in another workbook Gizmo63 Excel Worksheet Functions 2 May 15th 06 09:48 AM
how to create a macro that runs other macro in the same workbook VB Script for Excel Excel Programming 4 March 23rd 06 03:53 AM


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