+ Reply to Thread
Results 1 to 6 of 6

Copy formula from left and right column of user selected

  1. #1
    Forum Contributor
    Join Date
    05-01-2020
    Location
    CHENNAI
    MS-Off Ver
    EXCEL 2010
    Posts
    105

    Post Copy formula from left and right column of user selected

    Hi

    Please help me to create VBA Code

    Column F I am having "SUM" Formula, the same row on other columns the numbers are in paste special. I want to copy column F formula to left cells and right cells on

    Column F I am given as example this may be in G or H also, but entire column the formula should be in same column only

    selection of column where its having formula is required by user input. ( User to type column name ex "C")

    left and right columns also required as user input ( User to type C:E) for Left and Right(G:K) whatever they input the formula to be copied.
    Sample Formula copy.PNG

  2. #2
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Copy formula from left and right column of user selected

    If I'm not mistake to get what you mean....

    The activesheet has a formula in one column
    where in the formula there is going to be always has a text "sum",
    because the formula will always be sum formula ---> =SUM(cell:cell).

    The user has to tell the code on what column the formula is by typing the column letter
    for example type a (if the sum formula is in column A), type q (if the sum formula is in column Q), etc.

    The user also has to tell the code to what direction the code has to paste the copied formula.
    In this code case, type left (if the paste range is to the left), type right (if the paste range is to the right).

    Assuming that the condition of the active sheet is "clean" - no other thing which can disrupting the process code,
    the expected result is : to each row where the column has sum formula,
    this formula will be copied then paste either to the END-left or to the END-right column range.

    I do my way like this :
    Please Login or Register  to view this content.
    Last edited by karmapala; 05-23-2020 at 05:06 AM.

  3. #3
    Forum Contributor
    Join Date
    05-01-2020
    Location
    CHENNAI
    MS-Off Ver
    EXCEL 2010
    Posts
    105

    Re: Copy formula from left and right column of user selected

    Hi Thanks for the code

    The user also has to tell the code to what direction the code has to paste the copied formula.
    In this code case, type left (if the paste range is to the left), type right (if the paste range is to the right).

    Here need change, both left columns and right columns required by input box, like instead of type left ,user to provide coulmn reference example C:E and G:K
    Because A:B I have some text that should not be disturbed. Similarly on right colum L I have some text.
    That's why I mentioned in request list as below

    left and right columns also required as user input ( User to type C:E) for Left and Right(G:K) whatever they input the formula to be copied.

  4. #4
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Copy formula from left and right column of user selected

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-01-2020
    Location
    CHENNAI
    MS-Off Ver
    EXCEL 2010
    Posts
    105

    Re: Copy formula from left and right column of user selected

    Hi karmapala

    Thank you for your support. Code is working as expected.

  6. #6
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Copy formula from left and right column of user selected

    You're welcome, Saran89.
    Glad I can help.

+ 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. Edit Cell (column B) according to user's selected value on column A
    By cherrydee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2018, 02:40 AM
  2. copy selected column based on selected value to new worksheet
    By ladydee94 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2017, 02:36 AM
  3. Copy from closed WP selected in user from... help needed!
    By dmihaljevic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-10-2014, 10:09 AM
  4. Merge Selected cells and shift column contents Left
    By Brawnystaff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-02-2014, 02:22 PM
  5. Copy columns from one user selected workbook to another
    By bellfano in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2014, 03:29 AM
  6. [SOLVED] Need MACRO to copy the text in the cell left of first selected cells (a column), paste all
    By joobeng in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-16-2013, 06:42 AM
  7. macro to copy row selected by user
    By jimb0693 in forum Excel General
    Replies: 8
    Last Post: 04-21-2007, 10:11 PM

Tags for this Thread

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