+ Reply to Thread
Results 1 to 7 of 7

VBA to copy function acording to cell Value

Hybrid View

  1. #1
    Registered User
    Join Date
    05-19-2009
    Location
    Rio, Brasil
    MS-Off Ver
    Excel 2003
    Posts
    4

    VBA to copy function acording to cell Value

    Hello people

    I have the following problem.

    I have one sheet with a table that contains in each row a code and the 8 next cells (to the right) have formulas in it.
    I have about 20 rows, each with a code like "9x-wa", "SHBJ", "3dx2", etc

    In another worksheet this formulas need to be aplied according to the Code.
    So I have a cell in each row with these same codes, now I need to copy the formulas from the Sheet 1 to Sheet 2.

    I am pretty enw to VBA, so I was following a (copy, paste) logic, like:
    Copy code (9x-wa) from Sheet 2, Find "9x-wa" in Sheet 1, Copy the 8 cells to the right. Go back to sheet 2 and paste acording to row.....

    But I figured this is a pretty ugly way aint it? Is there any VBA funcion to make it easier?

    Thanks in advance.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: VBA to copy function acording to cell Value

    Welcome to the forum.
    But I figured this is a pretty ugly way aint it? Is there any VBA funcion to make it easier?
    It would be really ugly to try to answer your question without seeing a workbook with an example of what you have and what you want.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    05-19-2009
    Location
    Rio, Brasil
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA to copy function acording to cell Value

    Ups, Sorry, didnt see I could attach a file

    Basicly the yellow cells should be filled out with the formulas from the Formula sheet using the according function to the code.

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: VBA to copy function acording to cell Value

    Why do you need to do anything? The formulas are identical on the Formulas tab for all codes.
    Last edited by shg; 05-19-2009 at 04:56 PM.

  5. #5
    Registered User
    Join Date
    05-19-2009
    Location
    Rio, Brasil
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA to copy function acording to cell Value

    that was just an example file. actualy I have about 20 dirrerent formulas and codes.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: VBA to copy function acording to cell Value

    Are you familiar with named formulas?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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