+ Reply to Thread
Results 1 to 3 of 3

Being in one cell how copy from other cell content

  1. #1
    Registered User
    Join Date
    10-20-2008
    Location
    Brazil
    Posts
    1

    Being in one cell how copy from other cell content

    I have a formula on A1 = B1 + C1. I want to record a macro that being in any other cell of this worksheet copy the formula in A1 and stay in this same cell after the copy, always in relative way.
    Sample: If I am in G10 and copy the formula I will get G10=H10+I10 and stay in the G10 or If I am in K20 and copy the formula I will get K20=L20+M20 and so on.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Hi Lombardi, and welcome to the forum.

    Not sure why you would need a macro for this, but you could use:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-01-2008
    Location
    Houston, TX
    Posts
    70
    LOMBARDI,

    Here's one way to do what you want. Create a "named formula". Go to Insert>Name>Define and in the "Names in workbook" type a name for your formula, maybe "MyTotal" or whatever you like then click in the "Refers to" box and type =B1+C1 and click "Add".

    Now press Alt-F11 to open the VB editor and then click Insert>Module and paste the following macro

    Please Login or Register  to view this content.
    When the macro runs it will sum the two cells to the right of the active cell.
    Hope that's what you were looking for!
    GMc

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. code to copy a specified text in excel cell
    By docaia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2008, 05:45 AM
  2. copy formula from previos cell to next cell when i enter something
    By senk007 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-14-2007, 10:40 AM
  3. Replies: 11
    Last Post: 09-09-2007, 05:05 AM
  4. copy whats in a cell
    By jimmisavage in forum Excel General
    Replies: 3
    Last Post: 12-14-2006, 05:31 AM
  5. Help! Vba Copy Cell To Different Worksheet.
    By Dabooj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-03-2006, 05:53 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1