+ Reply to Thread
Results 1 to 6 of 6

copying formulas through vb

  1. #1
    Forum Contributor
    Join Date
    03-21-2007
    Posts
    118

    copying formulas through vb

    Hello all and thank you very much for all the support and help you have provided me until now.

    I am working on an update of one of my model files and need to make it more "automated".

    Here is the problem I am facing.

    I have a worksheet which practically has two tables.

    One table on the left has a number of columns with data.
    The other table on the right has a number of columns with formulas that process the data contained on the left table.

    I have put in the formulas on the first row of the right table and what I need to do it this:

    As I copy the data on the left table (say 1000 rows of data) I need the right table to automatically extend the formulas down each column until the end of the lines of the left table.

    I am facing two problems:

    1) The number of lines with data that I copy each time is uncertain and it can range from a few 100's to 1000's therefore I can not set a specific range through vbasic.

    2) I do not know how to auto-fill the formulas down the columns on my right table and make the auto-fill stop at the end of the data of the left column. I would prefer to do it with the following sequence:

    a) dump the data on the left table
    b) have a button that I press and automaticall fills-in the formulas on the right table.

    I am not sure if what I try to say is clear but if you need further explanation (or a better example) let me know.


    example:
    LEFT TABLE (DATA) RIGHT TABLE (FORMULAS)
    A B C D G H I
    8 9 1 3 FORMULA FORMULA FORMULA
    9 3 0 1 (MUST AUTO-FILL THE
    7 6 4 6 FORMULAS UNTIL THE
    0 9 8 8 END OF THE LEFT TABLE)
    .. .. .. ..
    .. .. .. ..


    Regards,

    Kostas

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Can you attach a small example?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    03-21-2007
    Posts
    118
    Here is an example of what I want to do.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Copying formulas

    Hi Kostas

    Something like this should work okay

    Please Login or Register  to view this content.
    Regards


    Jeff

  5. #5
    Forum Contributor
    Join Date
    03-21-2007
    Posts
    118
    Thank you very much,

    it seems to be working just fine!

    Regards,


    kostas

  6. #6
    Forum Contributor
    Join Date
    03-21-2007
    Posts
    118
    One more question,

    If I am using many worksheets in a workbook, how do I modify the macro to do the same job on each worksheet (they will be identical in structure but contain different data values). How do I assign the worksheet name within the macro ?

    Regards,

    Kostas

+ 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